objc2_home_kit/generated/
HMEvent.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    /// This class is used to represent a generic HomeKit event.
11    ///
12    /// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmevent?language=objc)
13    #[unsafe(super(NSObject))]
14    #[derive(Debug, PartialEq, Eq, Hash)]
15    pub struct HMEvent;
16);
17
18unsafe impl Send for HMEvent {}
19
20unsafe impl Sync for HMEvent {}
21
22extern_conformance!(
23    unsafe impl NSObjectProtocol for HMEvent {}
24);
25
26impl HMEvent {
27    extern_methods!(
28        #[deprecated = "HMEvent is abstract"]
29        #[unsafe(method(init))]
30        #[unsafe(method_family = init)]
31        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
32
33        #[deprecated = "HMEvent is abstract"]
34        #[unsafe(method(new))]
35        #[unsafe(method_family = new)]
36        pub unsafe fn new() -> Retained<Self>;
37
38        /// A unique identifier for the event.
39        ///
40        /// This property is not atomic.
41        ///
42        /// # Safety
43        ///
44        /// This might not be thread-safe.
45        #[unsafe(method(uniqueIdentifier))]
46        #[unsafe(method_family = none)]
47        pub unsafe fn uniqueIdentifier(&self) -> Retained<NSUUID>;
48
49        #[cfg(feature = "HMHome")]
50        /// Specifies whether the HMEvent can be added to HMEventTrigger on the given home.
51        #[unsafe(method(isSupportedForHome:))]
52        #[unsafe(method_family = none)]
53        pub unsafe fn isSupportedForHome(home: &HMHome) -> bool;
54    );
55}