objc2_foundation/generated/
NSUUID.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::*;
5
6use crate::*;
7
8extern_class!(
9    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsuuid?language=objc)
10    #[unsafe(super(NSObject))]
11    #[derive(PartialEq, Eq, Hash)]
12    pub struct NSUUID;
13);
14
15unsafe impl Send for NSUUID {}
16
17unsafe impl Sync for NSUUID {}
18
19#[cfg(feature = "NSObject")]
20unsafe impl NSCoding for NSUUID {}
21
22#[cfg(feature = "NSObject")]
23unsafe impl NSCopying for NSUUID {}
24
25#[cfg(feature = "NSObject")]
26unsafe impl CopyingHelper for NSUUID {
27    type Result = Self;
28}
29
30unsafe impl NSObjectProtocol for NSUUID {}
31
32#[cfg(feature = "NSObject")]
33unsafe impl NSSecureCoding for NSUUID {}
34
35impl NSUUID {
36    extern_methods!(
37        #[unsafe(method(UUID))]
38        #[unsafe(method_family = none)]
39        pub fn UUID() -> Retained<Self>;
40
41        #[unsafe(method(init))]
42        #[unsafe(method_family = init)]
43        pub fn init(this: Allocated<Self>) -> Retained<Self>;
44
45        #[cfg(feature = "NSString")]
46        #[unsafe(method(initWithUUIDString:))]
47        #[unsafe(method_family = init)]
48        pub fn initWithUUIDString(
49            this: Allocated<Self>,
50            string: &NSString,
51        ) -> Option<Retained<Self>>;
52
53        #[cfg(feature = "NSObjCRuntime")]
54        #[unsafe(method(compare:))]
55        #[unsafe(method_family = none)]
56        pub unsafe fn compare(&self, other_uuid: &NSUUID) -> NSComparisonResult;
57
58        #[cfg(feature = "NSString")]
59        #[unsafe(method(UUIDString))]
60        #[unsafe(method_family = none)]
61        pub fn UUIDString(&self) -> Retained<NSString>;
62    );
63}
64
65/// Methods declared on superclass `NSObject`.
66impl NSUUID {
67    extern_methods!(
68        #[unsafe(method(new))]
69        #[unsafe(method_family = new)]
70        pub fn new() -> Retained<Self>;
71    );
72}
73
74impl DefaultRetained for NSUUID {
75    #[inline]
76    fn default_retained() -> Retained<Self> {
77        Self::new()
78    }
79}