@@ -324,6 +324,17 @@ impl<'a> SinkPortInfo<'a> {
324
324
}
325
325
}
326
326
}
327
+
328
+ /// Creates a copy with owned data.
329
+ pub fn to_owned ( & self ) -> SinkPortInfo < ' static > {
330
+ SinkPortInfo {
331
+ name : self . name . clone ( ) . map ( |o| Cow :: Owned ( o. into_owned ( ) ) ) ,
332
+ description : self . description . clone ( ) . map ( |o| Cow :: Owned ( o. into_owned ( ) ) ) ,
333
+ #[ cfg( any( doc, feature = "pa_v14" ) ) ]
334
+ availability_group : self . availability_group . clone ( ) . map ( |o| Cow :: Owned ( o. into_owned ( ) ) ) ,
335
+ ..* self
336
+ }
337
+ }
327
338
}
328
339
329
340
/// Stores information about sinks.
@@ -452,6 +463,21 @@ impl<'a> SinkInfo<'a> {
452
463
}
453
464
}
454
465
}
466
+
467
+ /// Creates a copy with owned 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 . monitor_source_name . clone ( ) . map ( |o| Cow :: Owned ( o. into_owned ( ) ) ) ,
473
+ driver : self . driver . clone ( ) . map ( |o| Cow :: Owned ( o. into_owned ( ) ) ) ,
474
+ proplist : self . proplist . clone ( ) , //Our implementation makes an owned copy!
475
+ ports : self . ports . iter ( ) . map ( SinkPortInfo :: to_owned) . collect ( ) ,
476
+ active_port : self . active_port . as_ref ( ) . map ( |ap| Box :: new ( ap. as_ref ( ) . to_owned ( ) ) ) ,
477
+ formats : self . formats . clone ( ) , //Our implementation makes an owned copy!
478
+ ..* self
479
+ }
480
+ }
455
481
}
456
482
457
483
impl Introspector {
@@ -725,6 +751,17 @@ impl<'a> SourcePortInfo<'a> {
725
751
}
726
752
}
727
753
}
754
+
755
+ /// Creates a copy with owned data.
756
+ pub fn to_owned ( & self ) -> SourcePortInfo < ' static > {
757
+ SourcePortInfo {
758
+ name : self . name . clone ( ) . map ( |o| Cow :: Owned ( o. into_owned ( ) ) ) ,
759
+ description : self . description . clone ( ) . map ( |o| Cow :: Owned ( o. into_owned ( ) ) ) ,
760
+ #[ cfg( any( doc, feature = "pa_v14" ) ) ]
761
+ availability_group : self . availability_group . clone ( ) . map ( |o| Cow :: Owned ( o. into_owned ( ) ) ) ,
762
+ ..* self
763
+ }
764
+ }
728
765
}
729
766
730
767
/// Stores information about sources.
@@ -856,6 +893,21 @@ impl<'a> SourceInfo<'a> {
856
893
}
857
894
}
858
895
}
896
+
897
+ /// Creates a copy with owned data.
898
+ pub fn to_owned ( & self ) -> SourceInfo < ' static > {
899
+ SourceInfo {
900
+ name : self . name . clone ( ) . map ( |o| Cow :: Owned ( o. into_owned ( ) ) ) ,
901
+ description : self . description . clone ( ) . map ( |o| Cow :: Owned ( o. into_owned ( ) ) ) ,
902
+ monitor_of_sink_name : self . monitor_of_sink_name . clone ( ) . map ( |o| Cow :: Owned ( o. into_owned ( ) ) ) ,
903
+ driver : self . driver . clone ( ) . map ( |o| Cow :: Owned ( o. into_owned ( ) ) ) ,
904
+ proplist : self . proplist . clone ( ) , //Our implementation makes an owned copy!
905
+ ports : self . ports . iter ( ) . map ( SourcePortInfo :: to_owned) . collect ( ) ,
906
+ active_port : self . active_port . as_ref ( ) . map ( |ap| Box :: new ( ap. as_ref ( ) . to_owned ( ) ) ) ,
907
+ formats : self . formats . clone ( ) , //Our implementation makes an owned copy!
908
+ ..* self
909
+ }
910
+ }
859
911
}
860
912
861
913
impl Introspector {
@@ -1123,6 +1175,19 @@ impl<'a> ServerInfo<'a> {
1123
1175
}
1124
1176
}
1125
1177
}
1178
+
1179
+ /// Creates a copy with owned data.
1180
+ pub fn to_owned ( & self ) -> ServerInfo < ' static > {
1181
+ ServerInfo {
1182
+ user_name : self . user_name . clone ( ) . map ( |o| Cow :: Owned ( o. into_owned ( ) ) ) ,
1183
+ host_name : self . host_name . clone ( ) . map ( |o| Cow :: Owned ( o. into_owned ( ) ) ) ,
1184
+ server_version : self . server_version . clone ( ) . map ( |o| Cow :: Owned ( o. into_owned ( ) ) ) ,
1185
+ server_name : self . server_name . clone ( ) . map ( |o| Cow :: Owned ( o. into_owned ( ) ) ) ,
1186
+ default_sink_name : self . default_sink_name . clone ( ) . map ( |o| Cow :: Owned ( o. into_owned ( ) ) ) ,
1187
+ default_source_name : self . default_source_name . clone ( ) . map ( |o| Cow :: Owned ( o. into_owned ( ) ) ) ,
1188
+ ..* self
1189
+ }
1190
+ }
1126
1191
}
1127
1192
1128
1193
impl Introspector {
@@ -1200,6 +1265,16 @@ impl<'a> ModuleInfo<'a> {
1200
1265
}
1201
1266
}
1202
1267
}
1268
+
1269
+ /// Creates a copy with owned data.
1270
+ pub fn to_owned ( & self ) -> ModuleInfo < ' static > {
1271
+ ModuleInfo {
1272
+ name : self . name . clone ( ) . map ( |o| Cow :: Owned ( o. into_owned ( ) ) ) ,
1273
+ argument : self . argument . clone ( ) . map ( |o| Cow :: Owned ( o. into_owned ( ) ) ) ,
1274
+ proplist : self . proplist . clone ( ) , //Our implementation makes an owned copy!
1275
+ ..* self
1276
+ }
1277
+ }
1203
1278
}
1204
1279
1205
1280
impl Introspector {
@@ -1392,6 +1467,16 @@ impl<'a> ClientInfo<'a> {
1392
1467
}
1393
1468
}
1394
1469
}
1470
+
1471
+ /// Creates a copy with owned data.
1472
+ pub fn to_owned ( & self ) -> ClientInfo < ' static > {
1473
+ ClientInfo {
1474
+ name : self . name . clone ( ) . map ( |o| Cow :: Owned ( o. into_owned ( ) ) ) ,
1475
+ driver : self . driver . clone ( ) . map ( |o| Cow :: Owned ( o. into_owned ( ) ) ) ,
1476
+ proplist : self . proplist . clone ( ) , //Our implementation makes an owned copy!
1477
+ ..* self
1478
+ }
1479
+ }
1395
1480
}
1396
1481
1397
1482
impl Introspector {
@@ -1503,6 +1588,15 @@ impl<'a> CardProfileInfo<'a> {
1503
1588
}
1504
1589
}
1505
1590
}
1591
+
1592
+ /// Creates a copy with owned data.
1593
+ pub fn to_owned ( & self ) -> CardProfileInfo < ' static > {
1594
+ CardProfileInfo {
1595
+ name : self . name . clone ( ) . map ( |o| Cow :: Owned ( o. into_owned ( ) ) ) ,
1596
+ description : self . description . clone ( ) . map ( |o| Cow :: Owned ( o. into_owned ( ) ) ) ,
1597
+ ..* self
1598
+ }
1599
+ }
1506
1600
}
1507
1601
1508
1602
/// Stores information about a specific port of a card.
@@ -1596,6 +1690,19 @@ impl<'a> CardPortInfo<'a> {
1596
1690
}
1597
1691
}
1598
1692
}
1693
+
1694
+ /// Creates a copy with owned data.
1695
+ pub fn to_owned ( & self ) -> CardPortInfo < ' static > {
1696
+ CardPortInfo {
1697
+ name : self . name . clone ( ) . map ( |o| Cow :: Owned ( o. into_owned ( ) ) ) ,
1698
+ description : self . description . clone ( ) . map ( |o| Cow :: Owned ( o. into_owned ( ) ) ) ,
1699
+ proplist : self . proplist . clone ( ) , //Our implementation makes an owned copy!
1700
+ profiles : self . profiles . iter ( ) . map ( CardProfileInfo :: to_owned) . collect ( ) ,
1701
+ #[ cfg( any( doc, feature = "pa_v14" ) ) ]
1702
+ availability_group : self . availability_group . clone ( ) . map ( |o| Cow :: Owned ( o. into_owned ( ) ) ) ,
1703
+ ..* self
1704
+ }
1705
+ }
1599
1706
}
1600
1707
1601
1708
/// Stores information about cards.
@@ -1671,6 +1778,19 @@ impl<'a> CardInfo<'a> {
1671
1778
}
1672
1779
}
1673
1780
}
1781
+
1782
+ /// Creates a copy with owned data.
1783
+ pub fn to_owned ( & self ) -> CardInfo < ' static > {
1784
+ CardInfo {
1785
+ name : self . name . clone ( ) . map ( |o| Cow :: Owned ( o. into_owned ( ) ) ) ,
1786
+ driver : self . driver . clone ( ) . map ( |o| Cow :: Owned ( o. into_owned ( ) ) ) ,
1787
+ proplist : self . proplist . clone ( ) , //Our implementation makes an owned copy!
1788
+ ports : self . ports . iter ( ) . map ( CardPortInfo :: to_owned) . collect ( ) ,
1789
+ profiles : self . profiles . iter ( ) . map ( CardProfileInfo :: to_owned) . collect ( ) ,
1790
+ active_profile : self . active_profile . as_ref ( ) . map ( |ap| Box :: new ( ap. as_ref ( ) . to_owned ( ) ) ) ,
1791
+ ..* self
1792
+ }
1793
+ }
1674
1794
}
1675
1795
1676
1796
impl Introspector {
@@ -1895,6 +2015,18 @@ impl<'a> SinkInputInfo<'a> {
1895
2015
}
1896
2016
}
1897
2017
}
2018
+
2019
+ /// Creates a copy with owned data.
2020
+ pub fn to_owned ( & self ) -> SinkInputInfo < ' static > {
2021
+ SinkInputInfo {
2022
+ name : self . name . clone ( ) . map ( |o| Cow :: Owned ( o. into_owned ( ) ) ) ,
2023
+ resample_method : self . resample_method . clone ( ) . map ( |o| Cow :: Owned ( o. into_owned ( ) ) ) ,
2024
+ driver : self . driver . clone ( ) . map ( |o| Cow :: Owned ( o. into_owned ( ) ) ) ,
2025
+ proplist : self . proplist . clone ( ) , //Our implementation makes an owned copy!
2026
+ format : self . format . clone ( ) , //Our implementation makes an owned copy!
2027
+ ..* self
2028
+ }
2029
+ }
1898
2030
}
1899
2031
1900
2032
impl Introspector {
@@ -2124,6 +2256,18 @@ impl<'a> SourceOutputInfo<'a> {
2124
2256
}
2125
2257
}
2126
2258
}
2259
+
2260
+ /// Creates a copy with owned data.
2261
+ pub fn to_owned ( & self ) -> SourceOutputInfo < ' static > {
2262
+ SourceOutputInfo {
2263
+ name : self . name . clone ( ) . map ( |o| Cow :: Owned ( o. into_owned ( ) ) ) ,
2264
+ resample_method : self . resample_method . clone ( ) . map ( |o| Cow :: Owned ( o. into_owned ( ) ) ) ,
2265
+ driver : self . driver . clone ( ) . map ( |o| Cow :: Owned ( o. into_owned ( ) ) ) ,
2266
+ proplist : self . proplist . clone ( ) , //Our implementation makes an owned copy!
2267
+ format : self . format . clone ( ) , //Our implementation makes an owned copy!
2268
+ ..* self
2269
+ }
2270
+ }
2127
2271
}
2128
2272
2129
2273
impl Introspector {
@@ -2337,6 +2481,16 @@ impl<'a> SampleInfo<'a> {
2337
2481
}
2338
2482
}
2339
2483
}
2484
+
2485
+ /// Creates a copy with owned data.
2486
+ pub fn to_owned ( & self ) -> SampleInfo < ' static > {
2487
+ SampleInfo {
2488
+ name : self . name . clone ( ) . map ( |o| Cow :: Owned ( o. into_owned ( ) ) ) ,
2489
+ filename : self . filename . clone ( ) . map ( |o| Cow :: Owned ( o. into_owned ( ) ) ) ,
2490
+ proplist : self . proplist . clone ( ) , //Our implementation makes an owned copy!
2491
+ ..* self
2492
+ }
2493
+ }
2340
2494
}
2341
2495
2342
2496
impl Introspector {
0 commit comments