objc2_foundation/generated/
NSUUID.rs1use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5
6use crate::*;
7
8extern_class!(
9 #[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")]
20extern_conformance!(
21 unsafe impl NSCoding for NSUUID {}
22);
23
24#[cfg(feature = "NSObject")]
25extern_conformance!(
26 unsafe impl NSCopying for NSUUID {}
27);
28
29#[cfg(feature = "NSObject")]
30unsafe impl CopyingHelper for NSUUID {
31 type Result = Self;
32}
33
34extern_conformance!(
35 unsafe impl NSObjectProtocol for NSUUID {}
36);
37
38#[cfg(feature = "NSObject")]
39extern_conformance!(
40 unsafe impl NSSecureCoding for NSUUID {}
41);
42
43impl NSUUID {
44 extern_methods!(
45 #[unsafe(method(UUID))]
46 #[unsafe(method_family = none)]
47 pub fn UUID() -> Retained<Self>;
48
49 #[unsafe(method(init))]
50 #[unsafe(method_family = init)]
51 pub fn init(this: Allocated<Self>) -> Retained<Self>;
52
53 #[cfg(feature = "NSString")]
54 #[unsafe(method(initWithUUIDString:))]
55 #[unsafe(method_family = init)]
56 pub fn initWithUUIDString(
57 this: Allocated<Self>,
58 string: &NSString,
59 ) -> Option<Retained<Self>>;
60
61 #[cfg(feature = "NSObjCRuntime")]
62 #[unsafe(method(compare:))]
63 #[unsafe(method_family = none)]
64 pub unsafe fn compare(&self, other_uuid: &NSUUID) -> NSComparisonResult;
65
66 #[cfg(feature = "NSString")]
67 #[unsafe(method(UUIDString))]
68 #[unsafe(method_family = none)]
69 pub fn UUIDString(&self) -> Retained<NSString>;
70 );
71}
72
73impl NSUUID {
75 extern_methods!(
76 #[unsafe(method(new))]
77 #[unsafe(method_family = new)]
78 pub fn new() -> Retained<Self>;
79 );
80}
81
82impl DefaultRetained for NSUUID {
83 #[inline]
84 fn default_retained() -> Retained<Self> {
85 Self::new()
86 }
87}