objc2_home_kit/generated/
HMRoom.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
8use crate::*;
9
10extern_class!(
11    /// This class describes a room in the home.
12    ///
13    /// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmroom?language=objc)
14    #[unsafe(super(NSObject))]
15    #[derive(Debug, PartialEq, Eq, Hash)]
16    pub struct HMRoom;
17);
18
19unsafe impl Send for HMRoom {}
20
21unsafe impl Sync for HMRoom {}
22
23extern_conformance!(
24    unsafe impl NSObjectProtocol for HMRoom {}
25);
26
27impl HMRoom {
28    extern_methods!(
29        #[unsafe(method(init))]
30        #[unsafe(method_family = init)]
31        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
32
33        /// Name of the room.
34        ///
35        /// This property is not atomic.
36        ///
37        /// # Safety
38        ///
39        /// This might not be thread-safe.
40        #[unsafe(method(name))]
41        #[unsafe(method_family = none)]
42        pub unsafe fn name(&self) -> Retained<NSString>;
43
44        #[cfg(feature = "HMAccessory")]
45        /// Array of HMAccessory objects that correspond to the accessories
46        /// associated with this room.
47        ///
48        /// This property is not atomic.
49        ///
50        /// # Safety
51        ///
52        /// This might not be thread-safe.
53        #[unsafe(method(accessories))]
54        #[unsafe(method_family = none)]
55        pub unsafe fn accessories(&self) -> Retained<NSArray<HMAccessory>>;
56
57        /// A unique identifier for the room.
58        ///
59        /// This property is not atomic.
60        ///
61        /// # Safety
62        ///
63        /// This might not be thread-safe.
64        #[unsafe(method(uniqueIdentifier))]
65        #[unsafe(method_family = none)]
66        pub unsafe fn uniqueIdentifier(&self) -> Retained<NSUUID>;
67
68        #[cfg(feature = "block2")]
69        /// This method is used to change the name of the room.
70        ///
71        ///
72        /// Parameter `name`: New name for the room.
73        ///
74        ///
75        /// Parameter `completion`: Block that is invoked once the request is processed.
76        /// The NSError provides more information on the status of the request, error
77        /// will be nil on success.
78        #[unsafe(method(updateName:completionHandler:))]
79        #[unsafe(method_family = none)]
80        pub unsafe fn updateName_completionHandler(
81            &self,
82            name: &NSString,
83            completion: &block2::DynBlock<dyn Fn(*mut NSError)>,
84        );
85    );
86}
87
88/// Methods declared on superclass `NSObject`.
89impl HMRoom {
90    extern_methods!(
91        #[unsafe(method(new))]
92        #[unsafe(method_family = new)]
93        pub unsafe fn new() -> Retained<Self>;
94    );
95}