objc2_foundation/generated/
NSPortNameServer.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6
7use crate::*;
8
9extern_class!(
10 #[unsafe(super(NSObject))]
12 #[derive(Debug, PartialEq, Eq, Hash)]
13 #[deprecated = "Use NSXPCConnection instead"]
14 pub struct NSPortNameServer;
15);
16
17extern_conformance!(
18 unsafe impl NSObjectProtocol for NSPortNameServer {}
19);
20
21impl NSPortNameServer {
22 extern_methods!(
23 #[deprecated = "Use NSXPCConnection instead"]
24 #[unsafe(method(systemDefaultPortNameServer))]
25 #[unsafe(method_family = none)]
26 pub fn systemDefaultPortNameServer() -> Retained<NSPortNameServer>;
27
28 #[cfg(all(feature = "NSPort", feature = "NSString"))]
29 #[deprecated = "Use NSXPCConnection instead"]
30 #[unsafe(method(portForName:))]
31 #[unsafe(method_family = none)]
32 pub fn portForName(&self, name: &NSString) -> Option<Retained<NSPort>>;
33
34 #[cfg(all(feature = "NSPort", feature = "NSString"))]
35 #[deprecated = "Use NSXPCConnection instead"]
36 #[unsafe(method(portForName:host:))]
37 #[unsafe(method_family = none)]
38 pub fn portForName_host(
39 &self,
40 name: &NSString,
41 host: Option<&NSString>,
42 ) -> Option<Retained<NSPort>>;
43
44 #[cfg(all(feature = "NSPort", feature = "NSString"))]
45 #[deprecated = "Use NSXPCConnection instead"]
46 #[unsafe(method(registerPort:name:))]
47 #[unsafe(method_family = none)]
48 pub fn registerPort_name(&self, port: &NSPort, name: &NSString) -> bool;
49
50 #[cfg(feature = "NSString")]
51 #[deprecated = "Use NSXPCConnection instead"]
52 #[unsafe(method(removePortForName:))]
53 #[unsafe(method_family = none)]
54 pub fn removePortForName(&self, name: &NSString) -> bool;
55 );
56}
57
58impl NSPortNameServer {
60 extern_methods!(
61 #[unsafe(method(init))]
62 #[unsafe(method_family = init)]
63 pub fn init(this: Allocated<Self>) -> Retained<Self>;
64
65 #[unsafe(method(new))]
66 #[unsafe(method_family = new)]
67 pub fn new() -> Retained<Self>;
68 );
69}
70
71impl DefaultRetained for NSPortNameServer {
72 #[inline]
73 fn default_retained() -> Retained<Self> {
74 Self::new()
75 }
76}
77
78extern_class!(
79 #[unsafe(super(NSPortNameServer, NSObject))]
81 #[derive(Debug, PartialEq, Eq, Hash)]
82 #[deprecated = "Use NSXPCConnection instead"]
83 pub struct NSMachBootstrapServer;
84);
85
86extern_conformance!(
87 unsafe impl NSObjectProtocol for NSMachBootstrapServer {}
88);
89
90impl NSMachBootstrapServer {
91 extern_methods!(
92 #[deprecated = "Use NSXPCConnection instead"]
93 #[unsafe(method(sharedInstance))]
94 #[unsafe(method_family = none)]
95 pub fn sharedInstance() -> Retained<AnyObject>;
96
97 #[cfg(all(feature = "NSPort", feature = "NSString"))]
98 #[deprecated = "Use NSXPCConnection instead"]
99 #[unsafe(method(portForName:))]
100 #[unsafe(method_family = none)]
101 pub fn portForName(&self, name: &NSString) -> Option<Retained<NSPort>>;
102
103 #[cfg(all(feature = "NSPort", feature = "NSString"))]
104 #[deprecated = "Use NSXPCConnection instead"]
105 #[unsafe(method(portForName:host:))]
106 #[unsafe(method_family = none)]
107 pub fn portForName_host(
108 &self,
109 name: &NSString,
110 host: Option<&NSString>,
111 ) -> Option<Retained<NSPort>>;
112
113 #[cfg(all(feature = "NSPort", feature = "NSString"))]
114 #[deprecated = "Use NSXPCConnection instead"]
115 #[unsafe(method(registerPort:name:))]
116 #[unsafe(method_family = none)]
117 pub fn registerPort_name(&self, port: &NSPort, name: &NSString) -> bool;
118
119 #[cfg(all(feature = "NSPort", feature = "NSString"))]
120 #[unsafe(method(servicePortWithName:))]
121 #[unsafe(method_family = none)]
122 pub fn servicePortWithName(&self, name: &NSString) -> Option<Retained<NSPort>>;
123 );
124}
125
126impl NSMachBootstrapServer {
128 extern_methods!(
129 #[unsafe(method(init))]
130 #[unsafe(method_family = init)]
131 pub fn init(this: Allocated<Self>) -> Retained<Self>;
132
133 #[unsafe(method(new))]
134 #[unsafe(method_family = new)]
135 pub fn new() -> Retained<Self>;
136 );
137}
138
139impl DefaultRetained for NSMachBootstrapServer {
140 #[inline]
141 fn default_retained() -> Retained<Self> {
142 Self::new()
143 }
144}
145
146extern_class!(
147 #[unsafe(super(NSPortNameServer, NSObject))]
149 #[derive(Debug, PartialEq, Eq, Hash)]
150 #[deprecated = "Use NSXPCConnection instead"]
151 pub struct NSMessagePortNameServer;
152);
153
154extern_conformance!(
155 unsafe impl NSObjectProtocol for NSMessagePortNameServer {}
156);
157
158impl NSMessagePortNameServer {
159 extern_methods!(
160 #[deprecated = "Use NSXPCConnection instead"]
161 #[unsafe(method(sharedInstance))]
162 #[unsafe(method_family = none)]
163 pub fn sharedInstance() -> Retained<AnyObject>;
164
165 #[cfg(all(feature = "NSPort", feature = "NSString"))]
166 #[deprecated = "Use NSXPCConnection instead"]
167 #[unsafe(method(portForName:))]
168 #[unsafe(method_family = none)]
169 pub fn portForName(&self, name: &NSString) -> Option<Retained<NSPort>>;
170
171 #[cfg(all(feature = "NSPort", feature = "NSString"))]
172 #[deprecated = "Use NSXPCConnection instead"]
173 #[unsafe(method(portForName:host:))]
174 #[unsafe(method_family = none)]
175 pub fn portForName_host(
176 &self,
177 name: &NSString,
178 host: Option<&NSString>,
179 ) -> Option<Retained<NSPort>>;
180 );
181}
182
183impl NSMessagePortNameServer {
185 extern_methods!(
186 #[unsafe(method(init))]
187 #[unsafe(method_family = init)]
188 pub fn init(this: Allocated<Self>) -> Retained<Self>;
189
190 #[unsafe(method(new))]
191 #[unsafe(method_family = new)]
192 pub fn new() -> Retained<Self>;
193 );
194}
195
196impl DefaultRetained for NSMessagePortNameServer {
197 #[inline]
198 fn default_retained() -> Retained<Self> {
199 Self::new()
200 }
201}
202
203extern_class!(
204 #[unsafe(super(NSPortNameServer, NSObject))]
206 #[derive(Debug, PartialEq, Eq, Hash)]
207 #[deprecated = "Use NSXPCConnection instead"]
208 pub struct NSSocketPortNameServer;
209);
210
211extern_conformance!(
212 unsafe impl NSObjectProtocol for NSSocketPortNameServer {}
213);
214
215impl NSSocketPortNameServer {
216 extern_methods!(
217 #[deprecated = "Use NSXPCConnection instead"]
218 #[unsafe(method(sharedInstance))]
219 #[unsafe(method_family = none)]
220 pub fn sharedInstance() -> Retained<AnyObject>;
221
222 #[cfg(all(feature = "NSPort", feature = "NSString"))]
223 #[deprecated = "Use NSXPCConnection instead"]
224 #[unsafe(method(portForName:))]
225 #[unsafe(method_family = none)]
226 pub fn portForName(&self, name: &NSString) -> Option<Retained<NSPort>>;
227
228 #[cfg(all(feature = "NSPort", feature = "NSString"))]
229 #[deprecated = "Use NSXPCConnection instead"]
230 #[unsafe(method(portForName:host:))]
231 #[unsafe(method_family = none)]
232 pub fn portForName_host(
233 &self,
234 name: &NSString,
235 host: Option<&NSString>,
236 ) -> Option<Retained<NSPort>>;
237
238 #[cfg(all(feature = "NSPort", feature = "NSString"))]
239 #[deprecated = "Use NSXPCConnection instead"]
240 #[unsafe(method(registerPort:name:))]
241 #[unsafe(method_family = none)]
242 pub fn registerPort_name(&self, port: &NSPort, name: &NSString) -> bool;
243
244 #[cfg(feature = "NSString")]
245 #[deprecated = "Use NSXPCConnection instead"]
246 #[unsafe(method(removePortForName:))]
247 #[unsafe(method_family = none)]
248 pub fn removePortForName(&self, name: &NSString) -> bool;
249
250 #[cfg(all(feature = "NSPort", feature = "NSString"))]
251 #[deprecated = "Use NSXPCConnection instead"]
252 #[unsafe(method(portForName:host:nameServerPortNumber:))]
253 #[unsafe(method_family = none)]
254 pub fn portForName_host_nameServerPortNumber(
255 &self,
256 name: &NSString,
257 host: Option<&NSString>,
258 port_number: u16,
259 ) -> Option<Retained<NSPort>>;
260
261 #[cfg(all(feature = "NSPort", feature = "NSString"))]
262 #[deprecated = "Use NSXPCConnection instead"]
263 #[unsafe(method(registerPort:name:nameServerPortNumber:))]
264 #[unsafe(method_family = none)]
265 pub fn registerPort_name_nameServerPortNumber(
266 &self,
267 port: &NSPort,
268 name: &NSString,
269 port_number: u16,
270 ) -> bool;
271
272 #[deprecated = "Use NSXPCConnection instead"]
273 #[unsafe(method(defaultNameServerPortNumber))]
274 #[unsafe(method_family = none)]
275 pub fn defaultNameServerPortNumber(&self) -> u16;
276
277 #[deprecated = "Use NSXPCConnection instead"]
279 #[unsafe(method(setDefaultNameServerPortNumber:))]
280 #[unsafe(method_family = none)]
281 pub fn setDefaultNameServerPortNumber(&self, default_name_server_port_number: u16);
282 );
283}
284
285impl NSSocketPortNameServer {
287 extern_methods!(
288 #[unsafe(method(init))]
289 #[unsafe(method_family = init)]
290 pub fn init(this: Allocated<Self>) -> Retained<Self>;
291
292 #[unsafe(method(new))]
293 #[unsafe(method_family = new)]
294 pub fn new() -> Retained<Self>;
295 );
296}
297
298impl DefaultRetained for NSSocketPortNameServer {
299 #[inline]
300 fn default_retained() -> Retained<Self> {
301 Self::new()
302 }
303}