icrate/generated/Foundation/
NSPointerFunctions.rs1use crate::common::*;
4use crate::Foundation::*;
5
6ns_options!(
7 #[underlying(NSUInteger)]
8 pub enum NSPointerFunctionsOptions {
9 NSPointerFunctionsStrongMemory = 0 << 0,
10 #[deprecated = "GC no longer supported"]
11 NSPointerFunctionsZeroingWeakMemory = 1 << 0,
12 NSPointerFunctionsOpaqueMemory = 2 << 0,
13 NSPointerFunctionsMallocMemory = 3 << 0,
14 NSPointerFunctionsMachVirtualMemory = 4 << 0,
15 NSPointerFunctionsWeakMemory = 5 << 0,
16 NSPointerFunctionsObjectPersonality = 0 << 8,
17 NSPointerFunctionsOpaquePersonality = 1 << 8,
18 NSPointerFunctionsObjectPointerPersonality = 2 << 8,
19 NSPointerFunctionsCStringPersonality = 3 << 8,
20 NSPointerFunctionsStructPersonality = 4 << 8,
21 NSPointerFunctionsIntegerPersonality = 5 << 8,
22 NSPointerFunctionsCopyIn = 1 << 16,
23 }
24);
25
26extern_class!(
27 #[derive(Debug, PartialEq, Eq, Hash)]
28 #[cfg(feature = "Foundation_NSPointerFunctions")]
29 pub struct NSPointerFunctions;
30
31 #[cfg(feature = "Foundation_NSPointerFunctions")]
32 unsafe impl ClassType for NSPointerFunctions {
33 type Super = NSObject;
34 type Mutability = InteriorMutable;
35 }
36);
37
38#[cfg(feature = "Foundation_NSPointerFunctions")]
39unsafe impl NSCopying for NSPointerFunctions {}
40
41#[cfg(feature = "Foundation_NSPointerFunctions")]
42unsafe impl NSObjectProtocol for NSPointerFunctions {}
43
44extern_methods!(
45 #[cfg(feature = "Foundation_NSPointerFunctions")]
46 unsafe impl NSPointerFunctions {
47 #[method_id(@__retain_semantics Init initWithOptions:)]
48 pub unsafe fn initWithOptions(
49 this: Allocated<Self>,
50 options: NSPointerFunctionsOptions,
51 ) -> Id<Self>;
52
53 #[method_id(@__retain_semantics Other pointerFunctionsWithOptions:)]
54 pub unsafe fn pointerFunctionsWithOptions(
55 options: NSPointerFunctionsOptions,
56 ) -> Id<NSPointerFunctions>;
57
58 #[method(hashFunction)]
59 pub unsafe fn hashFunction(
60 &self,
61 ) -> Option<
62 unsafe extern "C" fn(
63 NonNull<c_void>,
64 Option<unsafe extern "C" fn(NonNull<c_void>) -> NSUInteger>,
65 ) -> NSUInteger,
66 >;
67
68 #[method(setHashFunction:)]
69 pub unsafe fn setHashFunction(
70 &self,
71 hash_function: Option<
72 unsafe extern "C" fn(
73 NonNull<c_void>,
74 Option<unsafe extern "C" fn(NonNull<c_void>) -> NSUInteger>,
75 ) -> NSUInteger,
76 >,
77 );
78
79 #[method(isEqualFunction)]
80 pub unsafe fn isEqualFunction(
81 &self,
82 ) -> Option<
83 unsafe extern "C" fn(
84 NonNull<c_void>,
85 NonNull<c_void>,
86 Option<unsafe extern "C" fn(NonNull<c_void>) -> NSUInteger>,
87 ) -> Bool,
88 >;
89
90 #[method(setIsEqualFunction:)]
91 pub unsafe fn setIsEqualFunction(
92 &self,
93 is_equal_function: Option<
94 unsafe extern "C" fn(
95 NonNull<c_void>,
96 NonNull<c_void>,
97 Option<unsafe extern "C" fn(NonNull<c_void>) -> NSUInteger>,
98 ) -> Bool,
99 >,
100 );
101
102 #[method(sizeFunction)]
103 pub unsafe fn sizeFunction(
104 &self,
105 ) -> Option<unsafe extern "C" fn(NonNull<c_void>) -> NSUInteger>;
106
107 #[method(setSizeFunction:)]
108 pub unsafe fn setSizeFunction(
109 &self,
110 size_function: Option<unsafe extern "C" fn(NonNull<c_void>) -> NSUInteger>,
111 );
112
113 #[cfg(feature = "Foundation_NSString")]
114 #[method(descriptionFunction)]
115 pub unsafe fn descriptionFunction(
116 &self,
117 ) -> Option<unsafe extern "C" fn(NonNull<c_void>) -> *mut NSString>;
118
119 #[cfg(feature = "Foundation_NSString")]
120 #[method(setDescriptionFunction:)]
121 pub unsafe fn setDescriptionFunction(
122 &self,
123 description_function: Option<unsafe extern "C" fn(NonNull<c_void>) -> *mut NSString>,
124 );
125
126 #[method(relinquishFunction)]
127 pub unsafe fn relinquishFunction(
128 &self,
129 ) -> Option<
130 unsafe extern "C" fn(
131 NonNull<c_void>,
132 Option<unsafe extern "C" fn(NonNull<c_void>) -> NSUInteger>,
133 ),
134 >;
135
136 #[method(setRelinquishFunction:)]
137 pub unsafe fn setRelinquishFunction(
138 &self,
139 relinquish_function: Option<
140 unsafe extern "C" fn(
141 NonNull<c_void>,
142 Option<unsafe extern "C" fn(NonNull<c_void>) -> NSUInteger>,
143 ),
144 >,
145 );
146
147 #[method(acquireFunction)]
148 pub unsafe fn acquireFunction(
149 &self,
150 ) -> Option<
151 unsafe extern "C" fn(
152 NonNull<c_void>,
153 Option<unsafe extern "C" fn(NonNull<c_void>) -> NSUInteger>,
154 Bool,
155 ) -> NonNull<c_void>,
156 >;
157
158 #[method(setAcquireFunction:)]
159 pub unsafe fn setAcquireFunction(
160 &self,
161 acquire_function: Option<
162 unsafe extern "C" fn(
163 NonNull<c_void>,
164 Option<unsafe extern "C" fn(NonNull<c_void>) -> NSUInteger>,
165 Bool,
166 ) -> NonNull<c_void>,
167 >,
168 );
169
170 #[deprecated = "Garbage collection no longer supported"]
171 #[method(usesStrongWriteBarrier)]
172 pub unsafe fn usesStrongWriteBarrier(&self) -> bool;
173
174 #[deprecated = "Garbage collection no longer supported"]
175 #[method(setUsesStrongWriteBarrier:)]
176 pub unsafe fn setUsesStrongWriteBarrier(&self, uses_strong_write_barrier: bool);
177
178 #[deprecated = "Garbage collection no longer supported"]
179 #[method(usesWeakReadAndWriteBarriers)]
180 pub unsafe fn usesWeakReadAndWriteBarriers(&self) -> bool;
181
182 #[deprecated = "Garbage collection no longer supported"]
183 #[method(setUsesWeakReadAndWriteBarriers:)]
184 pub unsafe fn setUsesWeakReadAndWriteBarriers(
185 &self,
186 uses_weak_read_and_write_barriers: bool,
187 );
188 }
189);
190
191extern_methods!(
192 #[cfg(feature = "Foundation_NSPointerFunctions")]
194 unsafe impl NSPointerFunctions {
195 #[method_id(@__retain_semantics Init init)]
196 pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;
197
198 #[method_id(@__retain_semantics New new)]
199 pub unsafe fn new() -> Id<Self>;
200 }
201);