objc2_home_kit/generated/
HMAccessoryProfile.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9extern_class!(
10    /// Represents a profile implemented by an accessory.
11    ///
12    /// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmaccessoryprofile?language=objc)
13    #[unsafe(super(NSObject))]
14    #[derive(Debug, PartialEq, Eq, Hash)]
15    pub struct HMAccessoryProfile;
16);
17
18unsafe impl Send for HMAccessoryProfile {}
19
20unsafe impl Sync for HMAccessoryProfile {}
21
22extern_conformance!(
23    unsafe impl NSObjectProtocol for HMAccessoryProfile {}
24);
25
26impl HMAccessoryProfile {
27    extern_methods!(
28        #[unsafe(method(init))]
29        #[unsafe(method_family = init)]
30        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
31
32        /// A unique identifier for the profile.
33        ///
34        /// This property is not atomic.
35        ///
36        /// # Safety
37        ///
38        /// This might not be thread-safe.
39        #[unsafe(method(uniqueIdentifier))]
40        #[unsafe(method_family = none)]
41        pub unsafe fn uniqueIdentifier(&self) -> Retained<NSUUID>;
42
43        #[cfg(feature = "HMService")]
44        /// Collection of services representing the profile.
45        ///
46        /// This property is not atomic.
47        ///
48        /// # Safety
49        ///
50        /// This might not be thread-safe.
51        #[unsafe(method(services))]
52        #[unsafe(method_family = none)]
53        pub unsafe fn services(&self) -> Retained<NSArray<HMService>>;
54
55        #[cfg(feature = "HMAccessory")]
56        /// Accessory implementing the profile.
57        ///
58        /// This property is not atomic.
59        ///
60        /// # Safety
61        ///
62        /// This might not be thread-safe.
63        #[unsafe(method(accessory))]
64        #[unsafe(method_family = none)]
65        pub unsafe fn accessory(&self) -> Option<Retained<HMAccessory>>;
66    );
67}
68
69/// Methods declared on superclass `NSObject`.
70impl HMAccessoryProfile {
71    extern_methods!(
72        #[unsafe(method(new))]
73        #[unsafe(method_family = new)]
74        pub unsafe fn new() -> Retained<Self>;
75    );
76}