objc2_device_discovery_extension/generated/
DDDevice.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7#[cfg(feature = "objc2-uniform-type-identifiers")]
8use objc2_uniform_type_identifiers::*;
9
10use crate::*;
11
12/// [Apple's documentation](https://developer.apple.com/documentation/devicediscoveryextension/dddeviceprotocolstring?language=objc)
13// NS_TYPED_ENUM
14pub type DDDeviceProtocolString = NSString;
15
16extern "C" {
17    /// [Apple's documentation](https://developer.apple.com/documentation/devicediscoveryextension/dddeviceprotocolstringinvalid?language=objc)
18    pub static DDDeviceProtocolStringInvalid: &'static DDDeviceProtocolString;
19}
20
21extern "C" {
22    /// [Apple's documentation](https://developer.apple.com/documentation/devicediscoveryextension/dddeviceprotocolstringdial?language=objc)
23    pub static DDDeviceProtocolStringDIAL: &'static DDDeviceProtocolString;
24}
25
26/// [Apple's documentation](https://developer.apple.com/documentation/devicediscoveryextension/dddeviceprotocol?language=objc)
27// NS_ENUM
28#[repr(transparent)]
29#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
30pub struct DDDeviceProtocol(pub NSInteger);
31impl DDDeviceProtocol {
32    #[doc(alias = "DDDeviceProtocolInvalid")]
33    pub const Invalid: Self = Self(0);
34    /// Invalid protocol.
35    #[doc(alias = "DDDeviceProtocolDIAL")]
36    pub const DIAL: Self = Self(1);
37}
38
39unsafe impl Encode for DDDeviceProtocol {
40    const ENCODING: Encoding = NSInteger::ENCODING;
41}
42
43unsafe impl RefEncode for DDDeviceProtocol {
44    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
45}
46
47impl DDDeviceProtocol {
48    /// Converts a device protocol type to a string for logging, etc.
49    #[doc(alias = "DDDeviceProtocolToString")]
50    #[inline]
51    pub unsafe fn to_string(self) -> Retained<NSString> {
52        extern "C-unwind" {
53            fn DDDeviceProtocolToString(in_value: DDDeviceProtocol) -> *mut NSString;
54        }
55        let ret = unsafe { DDDeviceProtocolToString(self) };
56        unsafe { Retained::retain_autoreleased(ret) }
57            .expect("function was marked as returning non-null, but actually returned NULL")
58    }
59}
60
61/// Category of the device.
62///
63/// See also [Apple's documentation](https://developer.apple.com/documentation/devicediscoveryextension/dddevicecategory?language=objc)
64// NS_ENUM
65#[repr(transparent)]
66#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
67pub struct DDDeviceCategory(pub NSInteger);
68impl DDDeviceCategory {
69    #[doc(alias = "DDDeviceCategoryHiFiSpeaker")]
70    pub const HiFiSpeaker: Self = Self(0);
71    /// Hi-Fi speaker.
72    #[doc(alias = "DDDeviceCategoryHiFiSpeakerMultiple")]
73    pub const HiFiSpeakerMultiple: Self = Self(1);
74    /// Multiple Hi-Fi speakers.
75    #[doc(alias = "DDDeviceCategoryTVWithMediaBox")]
76    pub const TVWithMediaBox: Self = Self(2);
77    /// TV with MediaBox.
78    #[doc(alias = "DDDeviceCategoryTV")]
79    pub const TV: Self = Self(3);
80    /// TV.
81    #[doc(alias = "DDDeviceCategoryLaptopComputer")]
82    pub const LaptopComputer: Self = Self(4);
83    /// Laptop computer.
84    #[doc(alias = "DDDeviceCategoryDesktopComputer")]
85    pub const DesktopComputer: Self = Self(5);
86    /// Desktop computer.
87    #[doc(alias = "DDDeviceCategoryAccessorySetup")]
88    pub const AccessorySetup: Self = Self(6);
89}
90
91unsafe impl Encode for DDDeviceCategory {
92    const ENCODING: Encoding = NSInteger::ENCODING;
93}
94
95unsafe impl RefEncode for DDDeviceCategory {
96    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
97}
98
99impl DDDeviceCategory {
100    /// Converts a device category to a string for logging, etc.
101    #[doc(alias = "DDDeviceCategoryToString")]
102    #[inline]
103    pub unsafe fn to_string(self) -> Retained<NSString> {
104        extern "C-unwind" {
105            fn DDDeviceCategoryToString(in_value: DDDeviceCategory) -> *mut NSString;
106        }
107        let ret = unsafe { DDDeviceCategoryToString(self) };
108        unsafe { Retained::retain_autoreleased(ret) }
109            .expect("function was marked as returning non-null, but actually returned NULL")
110    }
111}
112
113/// State of the device.
114///
115/// See also [Apple's documentation](https://developer.apple.com/documentation/devicediscoveryextension/dddevicestate?language=objc)
116// NS_ENUM
117#[repr(transparent)]
118#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
119pub struct DDDeviceState(pub NSInteger);
120impl DDDeviceState {
121    #[doc(alias = "DDDeviceStateInvalid")]
122    pub const Invalid: Self = Self(0);
123    /// Invalid/unapproved state.
124    #[doc(alias = "DDDeviceStateActivating")]
125    pub const Activating: Self = Self(10);
126    /// Selected by the user.
127    #[doc(alias = "DDDeviceStateActivated")]
128    pub const Activated: Self = Self(20);
129    /// Authorized and connected.
130    #[doc(alias = "DDDeviceStateAuthorized")]
131    pub const Authorized: Self = Self(25);
132    /// Authorized by the user.
133    #[doc(alias = "DDDeviceStateInvalidating")]
134    pub const Invalidating: Self = Self(30);
135}
136
137unsafe impl Encode for DDDeviceState {
138    const ENCODING: Encoding = NSInteger::ENCODING;
139}
140
141unsafe impl RefEncode for DDDeviceState {
142    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
143}
144
145impl DDDeviceState {
146    /// Converts a device state to a string for logging, etc.
147    #[doc(alias = "DDDeviceStateToString")]
148    #[inline]
149    pub unsafe fn to_string(self) -> Retained<NSString> {
150        extern "C-unwind" {
151            fn DDDeviceStateToString(in_value: DDDeviceState) -> *mut NSString;
152        }
153        let ret = unsafe { DDDeviceStateToString(self) };
154        unsafe { Retained::retain_autoreleased(ret) }
155            .expect("function was marked as returning non-null, but actually returned NULL")
156    }
157}
158
159/// State of media playback on the device.
160///
161/// See also [Apple's documentation](https://developer.apple.com/documentation/devicediscoveryextension/dddevicemediaplaybackstate?language=objc)
162// NS_ENUM
163#[repr(transparent)]
164#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
165pub struct DDDeviceMediaPlaybackState(pub NSInteger);
166impl DDDeviceMediaPlaybackState {
167    #[doc(alias = "DDDeviceMediaPlaybackStateNoContent")]
168    pub const NoContent: Self = Self(0);
169    /// Not playing any media content.
170    #[doc(alias = "DDDeviceMediaPlaybackStatePaused")]
171    pub const Paused: Self = Self(1);
172    /// Media content playback is paused.
173    #[doc(alias = "DDDeviceMediaPlaybackStatePlaying")]
174    pub const Playing: Self = Self(2);
175}
176
177unsafe impl Encode for DDDeviceMediaPlaybackState {
178    const ENCODING: Encoding = NSInteger::ENCODING;
179}
180
181unsafe impl RefEncode for DDDeviceMediaPlaybackState {
182    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
183}
184
185/// Device Support
186///
187/// See also [Apple's documentation](https://developer.apple.com/documentation/devicediscoveryextension/dddevicesupports?language=objc)
188// NS_OPTIONS
189#[repr(transparent)]
190#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
191pub struct DDDeviceSupports(pub NSUInteger);
192bitflags::bitflags! {
193    impl DDDeviceSupports: NSUInteger {
194        #[doc(alias = "DDDeviceSupportsBluetoothPairingLE")]
195        const BluetoothPairingLE = 1<<1;
196/// Device supports Bluetooth Low Energy pairing.
197        #[doc(alias = "DDDeviceSupportsBluetoothTransportBridging")]
198        const BluetoothTransportBridging = 1<<2;
199/// Device supports bring up of classic transport profiles when low energy transport for peripheral is connected.
200        #[doc(alias = "DDDeviceSupportsBluetoothHID")]
201        const BluetoothHID = 1<<3;
202    }
203}
204
205unsafe impl Encode for DDDeviceSupports {
206    const ENCODING: Encoding = NSUInteger::ENCODING;
207}
208
209unsafe impl RefEncode for DDDeviceSupports {
210    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
211}
212
213/// Wi-Fi Aware Service's Role
214///
215/// See also [Apple's documentation](https://developer.apple.com/documentation/devicediscoveryextension/dddevicewifiawareservicerole?language=objc)
216// NS_ENUM
217#[repr(transparent)]
218#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
219pub struct DDDeviceWiFiAwareServiceRole(pub NSInteger);
220impl DDDeviceWiFiAwareServiceRole {
221    #[doc(alias = "DDDeviceWiFiAwareServiceRoleSubscriber")]
222    pub const Subscriber: Self = Self(10);
223    #[doc(alias = "DDDeviceWiFiAwareServiceRolePublisher")]
224    pub const Publisher: Self = Self(20);
225}
226
227unsafe impl Encode for DDDeviceWiFiAwareServiceRole {
228    const ENCODING: Encoding = NSInteger::ENCODING;
229}
230
231unsafe impl RefEncode for DDDeviceWiFiAwareServiceRole {
232    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
233}
234
235impl DDDeviceMediaPlaybackState {
236    /// Converts a device media playback state to a string for logging, etc.
237    #[doc(alias = "DDDeviceMediaPlaybackStateToString")]
238    #[inline]
239    pub unsafe fn to_string(self) -> Retained<NSString> {
240        extern "C-unwind" {
241            fn DDDeviceMediaPlaybackStateToString(
242                in_value: DDDeviceMediaPlaybackState,
243            ) -> *mut NSString;
244        }
245        let ret = unsafe { DDDeviceMediaPlaybackStateToString(self) };
246        unsafe { Retained::retain_autoreleased(ret) }
247            .expect("function was marked as returning non-null, but actually returned NULL")
248    }
249}
250
251extern_class!(
252    /// DeviceDiscoveryExtension device.
253    ///
254    /// See also [Apple's documentation](https://developer.apple.com/documentation/devicediscoveryextension/dddevice?language=objc)
255    #[unsafe(super(NSObject))]
256    #[derive(Debug, PartialEq, Eq, Hash)]
257    pub struct DDDevice;
258);
259
260extern_conformance!(
261    unsafe impl NSObjectProtocol for DDDevice {}
262);
263
264impl DDDevice {
265    extern_methods!(
266        #[unsafe(method(init))]
267        #[unsafe(method_family = init)]
268        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
269
270        #[cfg(feature = "objc2-uniform-type-identifiers")]
271        /// Initializes a DD device with display name, category, protocol type, and identifier.
272        #[unsafe(method(initWithDisplayName:category:protocolType:identifier:))]
273        #[unsafe(method_family = init)]
274        pub unsafe fn initWithDisplayName_category_protocolType_identifier(
275            this: Allocated<Self>,
276            display_name: &NSString,
277            category: DDDeviceCategory,
278            protocol_type: &UTType,
279            identifier: &NSString,
280        ) -> Retained<Self>;
281
282        /// Device supported capabilities.
283        #[unsafe(method(deviceSupports))]
284        #[unsafe(method_family = none)]
285        pub unsafe fn deviceSupports(&self) -> DDDeviceSupports;
286
287        /// Setter for [`deviceSupports`][Self::deviceSupports].
288        #[unsafe(method(setDeviceSupports:))]
289        #[unsafe(method_family = none)]
290        pub unsafe fn setDeviceSupports(&self, device_supports: DDDeviceSupports);
291
292        /// Identifier to communicate with the device via Bluetooth.
293        #[unsafe(method(bluetoothIdentifier))]
294        #[unsafe(method_family = none)]
295        pub unsafe fn bluetoothIdentifier(&self) -> Option<Retained<NSUUID>>;
296
297        /// Setter for [`bluetoothIdentifier`][Self::bluetoothIdentifier].
298        #[unsafe(method(setBluetoothIdentifier:))]
299        #[unsafe(method_family = none)]
300        pub unsafe fn setBluetoothIdentifier(&self, bluetooth_identifier: Option<&NSUUID>);
301
302        /// Category of the device.
303        #[unsafe(method(category))]
304        #[unsafe(method_family = none)]
305        pub unsafe fn category(&self) -> DDDeviceCategory;
306
307        /// Setter for [`category`][Self::category].
308        #[unsafe(method(setCategory:))]
309        #[unsafe(method_family = none)]
310        pub unsafe fn setCategory(&self, category: DDDeviceCategory);
311
312        /// Device's custom asset for product image name in the main App bundle.
313        #[unsafe(method(displayImageName))]
314        #[unsafe(method_family = none)]
315        pub unsafe fn displayImageName(&self) -> Option<Retained<NSString>>;
316
317        /// Setter for [`displayImageName`][Self::displayImageName].
318        ///
319        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
320        #[unsafe(method(setDisplayImageName:))]
321        #[unsafe(method_family = none)]
322        pub unsafe fn setDisplayImageName(&self, display_image_name: Option<&NSString>);
323
324        /// Name of the device. Should be suitable for displaying to a user.
325        #[unsafe(method(displayName))]
326        #[unsafe(method_family = none)]
327        pub unsafe fn displayName(&self) -> Retained<NSString>;
328
329        /// Setter for [`displayName`][Self::displayName].
330        ///
331        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
332        #[unsafe(method(setDisplayName:))]
333        #[unsafe(method_family = none)]
334        pub unsafe fn setDisplayName(&self, display_name: &NSString);
335
336        /// Identifier of the device.
337        #[unsafe(method(identifier))]
338        #[unsafe(method_family = none)]
339        pub unsafe fn identifier(&self) -> Retained<NSString>;
340
341        /// Setter for [`identifier`][Self::identifier].
342        ///
343        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
344        #[unsafe(method(setIdentifier:))]
345        #[unsafe(method_family = none)]
346        pub unsafe fn setIdentifier(&self, identifier: &NSString);
347
348        /// Current state of media playback on this device.
349        #[unsafe(method(mediaPlaybackState))]
350        #[unsafe(method_family = none)]
351        pub unsafe fn mediaPlaybackState(&self) -> DDDeviceMediaPlaybackState;
352
353        /// Setter for [`mediaPlaybackState`][Self::mediaPlaybackState].
354        #[unsafe(method(setMediaPlaybackState:))]
355        #[unsafe(method_family = none)]
356        pub unsafe fn setMediaPlaybackState(
357            &self,
358            media_playback_state: DDDeviceMediaPlaybackState,
359        );
360
361        /// Title of the media content being played.
362        #[unsafe(method(mediaContentTitle))]
363        #[unsafe(method_family = none)]
364        pub unsafe fn mediaContentTitle(&self) -> Option<Retained<NSString>>;
365
366        /// Setter for [`mediaContentTitle`][Self::mediaContentTitle].
367        ///
368        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
369        #[unsafe(method(setMediaContentTitle:))]
370        #[unsafe(method_family = none)]
371        pub unsafe fn setMediaContentTitle(&self, media_content_title: Option<&NSString>);
372
373        /// Subtitle of the media content being played. It can be used to display extra information about the content, such as the name of the artist.
374        #[unsafe(method(mediaContentSubtitle))]
375        #[unsafe(method_family = none)]
376        pub unsafe fn mediaContentSubtitle(&self) -> Option<Retained<NSString>>;
377
378        /// Setter for [`mediaContentSubtitle`][Self::mediaContentSubtitle].
379        ///
380        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
381        #[unsafe(method(setMediaContentSubtitle:))]
382        #[unsafe(method_family = none)]
383        pub unsafe fn setMediaContentSubtitle(&self, media_content_subtitle: Option<&NSString>);
384
385        /// Protocol of the device.
386        #[unsafe(method(protocol))]
387        #[unsafe(method_family = none)]
388        pub unsafe fn protocol(&self) -> DDDeviceProtocol;
389
390        /// Setter for [`protocol`][Self::protocol].
391        #[unsafe(method(setProtocol:))]
392        #[unsafe(method_family = none)]
393        pub unsafe fn setProtocol(&self, protocol: DDDeviceProtocol);
394
395        #[cfg(feature = "objc2-uniform-type-identifiers")]
396        /// Uniform Type for the protocol.
397        #[unsafe(method(protocolType))]
398        #[unsafe(method_family = none)]
399        pub unsafe fn protocolType(&self) -> Retained<UTType>;
400
401        #[cfg(feature = "objc2-uniform-type-identifiers")]
402        /// Setter for [`protocolType`][Self::protocolType].
403        #[unsafe(method(setProtocolType:))]
404        #[unsafe(method_family = none)]
405        pub unsafe fn setProtocolType(&self, protocol_type: &UTType);
406
407        /// State of the device.
408        #[unsafe(method(state))]
409        #[unsafe(method_family = none)]
410        pub unsafe fn state(&self) -> DDDeviceState;
411
412        /// Setter for [`state`][Self::state].
413        #[unsafe(method(setState:))]
414        #[unsafe(method_family = none)]
415        pub unsafe fn setState(&self, state: DDDeviceState);
416
417        /// Device's WiFi Hotspot SSID.
418        #[unsafe(method(SSID))]
419        #[unsafe(method_family = none)]
420        pub unsafe fn SSID(&self) -> Option<Retained<NSString>>;
421
422        /// Setter for [`SSID`][Self::SSID].
423        ///
424        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
425        #[unsafe(method(setSSID:))]
426        #[unsafe(method_family = none)]
427        pub unsafe fn setSSID(&self, ssid: Option<&NSString>);
428
429        /// Whether the device supports grouping with other devices with the same protocol.
430        #[unsafe(method(supportsGrouping))]
431        #[unsafe(method_family = none)]
432        pub unsafe fn supportsGrouping(&self) -> bool;
433
434        /// Setter for [`supportsGrouping`][Self::supportsGrouping].
435        #[unsafe(method(setSupportsGrouping:))]
436        #[unsafe(method_family = none)]
437        pub unsafe fn setSupportsGrouping(&self, supports_grouping: bool);
438
439        /// TXT record of the device.
440        #[unsafe(method(txtRecordData))]
441        #[unsafe(method_family = none)]
442        pub unsafe fn txtRecordData(&self) -> Option<Retained<NSData>>;
443
444        /// Setter for [`txtRecordData`][Self::txtRecordData].
445        ///
446        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
447        #[unsafe(method(setTxtRecordData:))]
448        #[unsafe(method_family = none)]
449        pub unsafe fn setTxtRecordData(&self, txt_record_data: Option<&NSData>);
450
451        /// URL used for SSDP connection.
452        /// The URL must have a valid hostname, no query parameters, and a maximum size of 100 bytes.
453        #[unsafe(method(url))]
454        #[unsafe(method_family = none)]
455        pub unsafe fn url(&self) -> Retained<NSURL>;
456
457        /// Setter for [`url`][Self::url].
458        ///
459        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
460        #[unsafe(method(setUrl:))]
461        #[unsafe(method_family = none)]
462        pub unsafe fn setUrl(&self, url: &NSURL);
463
464        /// Device's Wi-Fi Aware's service name.
465        #[unsafe(method(wifiAwareServiceName))]
466        #[unsafe(method_family = none)]
467        pub unsafe fn wifiAwareServiceName(&self) -> Option<Retained<NSString>>;
468
469        /// Setter for [`wifiAwareServiceName`][Self::wifiAwareServiceName].
470        ///
471        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
472        #[unsafe(method(setWifiAwareServiceName:))]
473        #[unsafe(method_family = none)]
474        pub unsafe fn setWifiAwareServiceName(&self, wifi_aware_service_name: Option<&NSString>);
475
476        /// Device's Wi-Fi Aware's service. Default is `DDDeviceWiFiAwareServiceRoleSubscriber`
477        #[unsafe(method(wifiAwareServiceRole))]
478        #[unsafe(method_family = none)]
479        pub unsafe fn wifiAwareServiceRole(&self) -> DDDeviceWiFiAwareServiceRole;
480
481        /// Setter for [`wifiAwareServiceRole`][Self::wifiAwareServiceRole].
482        #[unsafe(method(setWifiAwareServiceRole:))]
483        #[unsafe(method_family = none)]
484        pub unsafe fn setWifiAwareServiceRole(
485            &self,
486            wifi_aware_service_role: DDDeviceWiFiAwareServiceRole,
487        );
488
489        /// Device's Wi-Fi Aware model name.
490        #[unsafe(method(wifiAwareModelName))]
491        #[unsafe(method_family = none)]
492        pub unsafe fn wifiAwareModelName(&self) -> Option<Retained<NSString>>;
493
494        /// Setter for [`wifiAwareModelName`][Self::wifiAwareModelName].
495        ///
496        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
497        #[unsafe(method(setWifiAwareModelName:))]
498        #[unsafe(method_family = none)]
499        pub unsafe fn setWifiAwareModelName(&self, wifi_aware_model_name: Option<&NSString>);
500
501        /// Device's Wi-Fi Aware vendor name.
502        #[unsafe(method(wifiAwareVendorName))]
503        #[unsafe(method_family = none)]
504        pub unsafe fn wifiAwareVendorName(&self) -> Option<Retained<NSString>>;
505
506        /// Setter for [`wifiAwareVendorName`][Self::wifiAwareVendorName].
507        ///
508        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
509        #[unsafe(method(setWifiAwareVendorName:))]
510        #[unsafe(method_family = none)]
511        pub unsafe fn setWifiAwareVendorName(&self, wifi_aware_vendor_name: Option<&NSString>);
512    );
513}
514
515/// Methods declared on superclass `NSObject`.
516impl DDDevice {
517    extern_methods!(
518        #[unsafe(method(new))]
519        #[unsafe(method_family = new)]
520        pub unsafe fn new() -> Retained<Self>;
521    );
522}
523
524#[deprecated = "renamed to `DDDeviceProtocol::to_string`"]
525#[inline]
526pub unsafe extern "C-unwind" fn DDDeviceProtocolToString(
527    in_value: DDDeviceProtocol,
528) -> Retained<NSString> {
529    extern "C-unwind" {
530        fn DDDeviceProtocolToString(in_value: DDDeviceProtocol) -> *mut NSString;
531    }
532    let ret = unsafe { DDDeviceProtocolToString(in_value) };
533    unsafe { Retained::retain_autoreleased(ret) }
534        .expect("function was marked as returning non-null, but actually returned NULL")
535}
536
537#[deprecated = "renamed to `DDDeviceCategory::to_string`"]
538#[inline]
539pub unsafe extern "C-unwind" fn DDDeviceCategoryToString(
540    in_value: DDDeviceCategory,
541) -> Retained<NSString> {
542    extern "C-unwind" {
543        fn DDDeviceCategoryToString(in_value: DDDeviceCategory) -> *mut NSString;
544    }
545    let ret = unsafe { DDDeviceCategoryToString(in_value) };
546    unsafe { Retained::retain_autoreleased(ret) }
547        .expect("function was marked as returning non-null, but actually returned NULL")
548}
549
550#[deprecated = "renamed to `DDDeviceState::to_string`"]
551#[inline]
552pub unsafe extern "C-unwind" fn DDDeviceStateToString(
553    in_value: DDDeviceState,
554) -> Retained<NSString> {
555    extern "C-unwind" {
556        fn DDDeviceStateToString(in_value: DDDeviceState) -> *mut NSString;
557    }
558    let ret = unsafe { DDDeviceStateToString(in_value) };
559    unsafe { Retained::retain_autoreleased(ret) }
560        .expect("function was marked as returning non-null, but actually returned NULL")
561}
562
563#[deprecated = "renamed to `DDDeviceMediaPlaybackState::to_string`"]
564#[inline]
565pub unsafe extern "C-unwind" fn DDDeviceMediaPlaybackStateToString(
566    in_value: DDDeviceMediaPlaybackState,
567) -> Retained<NSString> {
568    extern "C-unwind" {
569        fn DDDeviceMediaPlaybackStateToString(
570            in_value: DDDeviceMediaPlaybackState,
571        ) -> *mut NSString;
572    }
573    let ret = unsafe { DDDeviceMediaPlaybackStateToString(in_value) };
574    unsafe { Retained::retain_autoreleased(ret) }
575        .expect("function was marked as returning non-null, but actually returned NULL")
576}