File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
pulse-binding/src/context Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -463,6 +463,27 @@ impl<'a> SinkInfo<'a> {
463
463
}
464
464
}
465
465
}
466
+
467
+ /// Creates owned data from borrowed data
468
+ pub fn to_owned ( & self ) -> SinkInfo < ' static > {
469
+ SinkInfo {
470
+ name : self . name . clone ( ) . map ( |o| Cow :: Owned ( o. into_owned ( ) ) ) ,
471
+ description : self . description . clone ( ) . map ( |o| Cow :: Owned ( o. into_owned ( ) ) ) ,
472
+ monitor_source_name : self
473
+ . monitor_source_name
474
+ . clone ( )
475
+ . map ( |o| Cow :: Owned ( o. into_owned ( ) ) ) ,
476
+ driver : self . driver . clone ( ) . map ( |o| Cow :: Owned ( o. into_owned ( ) ) ) ,
477
+ proplist : self . proplist . clone ( ) ,
478
+ ports : self . ports . iter ( ) . map ( SinkPortInfo :: to_owned) . collect ( ) ,
479
+ active_port : self
480
+ . active_port
481
+ . as_ref ( )
482
+ . map ( |spi| Box :: new ( spi. as_ref ( ) . to_owned ( ) ) ) ,
483
+ formats : self . formats . clone ( ) ,
484
+ ..* self
485
+ }
486
+ }
466
487
}
467
488
468
489
impl Introspector {
You can’t perform that action at this time.
0 commit comments