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
22unsafe impl NSObjectProtocol for HMAccessoryProfile {}
23
24impl HMAccessoryProfile {
25    extern_methods!(
26        #[unsafe(method(init))]
27        #[unsafe(method_family = init)]
28        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
29
30        /// A unique identifier for the profile.
31        #[unsafe(method(uniqueIdentifier))]
32        #[unsafe(method_family = none)]
33        pub unsafe fn uniqueIdentifier(&self) -> Retained<NSUUID>;
34
35        #[cfg(feature = "HMService")]
36        /// Collection of services representing the profile.
37        #[unsafe(method(services))]
38        #[unsafe(method_family = none)]
39        pub unsafe fn services(&self) -> Retained<NSArray<HMService>>;
40
41        #[cfg(feature = "HMAccessory")]
42        /// Accessory implementing the profile.
43        #[unsafe(method(accessory))]
44        #[unsafe(method_family = none)]
45        pub unsafe fn accessory(&self) -> Option<Retained<HMAccessory>>;
46    );
47}
48
49/// Methods declared on superclass `NSObject`.
50impl HMAccessoryProfile {
51    extern_methods!(
52        #[unsafe(method(new))]
53        #[unsafe(method_family = new)]
54        pub unsafe fn new() -> Retained<Self>;
55    );
56}