objc2_foundation/generated/
NSPortNameServer.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6
7use crate::*;
8
9extern_class!(
10    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsportnameserver?language=objc)
11    #[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 unsafe 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 unsafe 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 unsafe 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 unsafe 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 unsafe fn removePortForName(&self, name: &NSString) -> bool;
55    );
56}
57
58/// Methods declared on superclass `NSObject`.
59impl NSPortNameServer {
60    extern_methods!(
61        #[unsafe(method(init))]
62        #[unsafe(method_family = init)]
63        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
64
65        #[unsafe(method(new))]
66        #[unsafe(method_family = new)]
67        pub unsafe fn new() -> Retained<Self>;
68    );
69}
70
71extern_class!(
72    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsmachbootstrapserver?language=objc)
73    #[unsafe(super(NSPortNameServer, NSObject))]
74    #[derive(Debug, PartialEq, Eq, Hash)]
75    #[deprecated = "Use NSXPCConnection instead"]
76    pub struct NSMachBootstrapServer;
77);
78
79extern_conformance!(
80    unsafe impl NSObjectProtocol for NSMachBootstrapServer {}
81);
82
83impl NSMachBootstrapServer {
84    extern_methods!(
85        #[deprecated = "Use NSXPCConnection instead"]
86        #[unsafe(method(sharedInstance))]
87        #[unsafe(method_family = none)]
88        pub unsafe fn sharedInstance() -> Retained<AnyObject>;
89
90        #[cfg(all(feature = "NSPort", feature = "NSString"))]
91        #[deprecated = "Use NSXPCConnection instead"]
92        #[unsafe(method(portForName:))]
93        #[unsafe(method_family = none)]
94        pub unsafe fn portForName(&self, name: &NSString) -> Option<Retained<NSPort>>;
95
96        #[cfg(all(feature = "NSPort", feature = "NSString"))]
97        #[deprecated = "Use NSXPCConnection instead"]
98        #[unsafe(method(portForName:host:))]
99        #[unsafe(method_family = none)]
100        pub unsafe fn portForName_host(
101            &self,
102            name: &NSString,
103            host: Option<&NSString>,
104        ) -> Option<Retained<NSPort>>;
105
106        #[cfg(all(feature = "NSPort", feature = "NSString"))]
107        #[deprecated = "Use NSXPCConnection instead"]
108        #[unsafe(method(registerPort:name:))]
109        #[unsafe(method_family = none)]
110        pub unsafe fn registerPort_name(&self, port: &NSPort, name: &NSString) -> bool;
111
112        #[cfg(all(feature = "NSPort", feature = "NSString"))]
113        #[unsafe(method(servicePortWithName:))]
114        #[unsafe(method_family = none)]
115        pub unsafe fn servicePortWithName(&self, name: &NSString) -> Option<Retained<NSPort>>;
116    );
117}
118
119/// Methods declared on superclass `NSObject`.
120impl NSMachBootstrapServer {
121    extern_methods!(
122        #[unsafe(method(init))]
123        #[unsafe(method_family = init)]
124        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
125
126        #[unsafe(method(new))]
127        #[unsafe(method_family = new)]
128        pub unsafe fn new() -> Retained<Self>;
129    );
130}
131
132extern_class!(
133    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsmessageportnameserver?language=objc)
134    #[unsafe(super(NSPortNameServer, NSObject))]
135    #[derive(Debug, PartialEq, Eq, Hash)]
136    #[deprecated = "Use NSXPCConnection instead"]
137    pub struct NSMessagePortNameServer;
138);
139
140extern_conformance!(
141    unsafe impl NSObjectProtocol for NSMessagePortNameServer {}
142);
143
144impl NSMessagePortNameServer {
145    extern_methods!(
146        #[deprecated = "Use NSXPCConnection instead"]
147        #[unsafe(method(sharedInstance))]
148        #[unsafe(method_family = none)]
149        pub unsafe fn sharedInstance() -> Retained<AnyObject>;
150
151        #[cfg(all(feature = "NSPort", feature = "NSString"))]
152        #[deprecated = "Use NSXPCConnection instead"]
153        #[unsafe(method(portForName:))]
154        #[unsafe(method_family = none)]
155        pub unsafe fn portForName(&self, name: &NSString) -> Option<Retained<NSPort>>;
156
157        #[cfg(all(feature = "NSPort", feature = "NSString"))]
158        #[deprecated = "Use NSXPCConnection instead"]
159        #[unsafe(method(portForName:host:))]
160        #[unsafe(method_family = none)]
161        pub unsafe fn portForName_host(
162            &self,
163            name: &NSString,
164            host: Option<&NSString>,
165        ) -> Option<Retained<NSPort>>;
166    );
167}
168
169/// Methods declared on superclass `NSObject`.
170impl NSMessagePortNameServer {
171    extern_methods!(
172        #[unsafe(method(init))]
173        #[unsafe(method_family = init)]
174        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
175
176        #[unsafe(method(new))]
177        #[unsafe(method_family = new)]
178        pub unsafe fn new() -> Retained<Self>;
179    );
180}
181
182extern_class!(
183    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nssocketportnameserver?language=objc)
184    #[unsafe(super(NSPortNameServer, NSObject))]
185    #[derive(Debug, PartialEq, Eq, Hash)]
186    #[deprecated = "Use NSXPCConnection instead"]
187    pub struct NSSocketPortNameServer;
188);
189
190extern_conformance!(
191    unsafe impl NSObjectProtocol for NSSocketPortNameServer {}
192);
193
194impl NSSocketPortNameServer {
195    extern_methods!(
196        #[deprecated = "Use NSXPCConnection instead"]
197        #[unsafe(method(sharedInstance))]
198        #[unsafe(method_family = none)]
199        pub unsafe fn sharedInstance() -> Retained<AnyObject>;
200
201        #[cfg(all(feature = "NSPort", feature = "NSString"))]
202        #[deprecated = "Use NSXPCConnection instead"]
203        #[unsafe(method(portForName:))]
204        #[unsafe(method_family = none)]
205        pub unsafe fn portForName(&self, name: &NSString) -> Option<Retained<NSPort>>;
206
207        #[cfg(all(feature = "NSPort", feature = "NSString"))]
208        #[deprecated = "Use NSXPCConnection instead"]
209        #[unsafe(method(portForName:host:))]
210        #[unsafe(method_family = none)]
211        pub unsafe fn portForName_host(
212            &self,
213            name: &NSString,
214            host: Option<&NSString>,
215        ) -> Option<Retained<NSPort>>;
216
217        #[cfg(all(feature = "NSPort", feature = "NSString"))]
218        #[deprecated = "Use NSXPCConnection instead"]
219        #[unsafe(method(registerPort:name:))]
220        #[unsafe(method_family = none)]
221        pub unsafe fn registerPort_name(&self, port: &NSPort, name: &NSString) -> bool;
222
223        #[cfg(feature = "NSString")]
224        #[deprecated = "Use NSXPCConnection instead"]
225        #[unsafe(method(removePortForName:))]
226        #[unsafe(method_family = none)]
227        pub unsafe fn removePortForName(&self, name: &NSString) -> bool;
228
229        #[cfg(all(feature = "NSPort", feature = "NSString"))]
230        #[deprecated = "Use NSXPCConnection instead"]
231        #[unsafe(method(portForName:host:nameServerPortNumber:))]
232        #[unsafe(method_family = none)]
233        pub unsafe fn portForName_host_nameServerPortNumber(
234            &self,
235            name: &NSString,
236            host: Option<&NSString>,
237            port_number: u16,
238        ) -> Option<Retained<NSPort>>;
239
240        #[cfg(all(feature = "NSPort", feature = "NSString"))]
241        #[deprecated = "Use NSXPCConnection instead"]
242        #[unsafe(method(registerPort:name:nameServerPortNumber:))]
243        #[unsafe(method_family = none)]
244        pub unsafe fn registerPort_name_nameServerPortNumber(
245            &self,
246            port: &NSPort,
247            name: &NSString,
248            port_number: u16,
249        ) -> bool;
250
251        #[deprecated = "Use NSXPCConnection instead"]
252        #[unsafe(method(defaultNameServerPortNumber))]
253        #[unsafe(method_family = none)]
254        pub unsafe fn defaultNameServerPortNumber(&self) -> u16;
255
256        /// Setter for [`defaultNameServerPortNumber`][Self::defaultNameServerPortNumber].
257        #[deprecated = "Use NSXPCConnection instead"]
258        #[unsafe(method(setDefaultNameServerPortNumber:))]
259        #[unsafe(method_family = none)]
260        pub unsafe fn setDefaultNameServerPortNumber(&self, default_name_server_port_number: u16);
261    );
262}
263
264/// Methods declared on superclass `NSObject`.
265impl NSSocketPortNameServer {
266    extern_methods!(
267        #[unsafe(method(init))]
268        #[unsafe(method_family = init)]
269        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
270
271        #[unsafe(method(new))]
272        #[unsafe(method_family = new)]
273        pub unsafe fn new() -> Retained<Self>;
274    );
275}