objc2_core_services/generated/OSServices/
WSMethodInvocation.rs1use core::cell::UnsafeCell;
4use core::ffi::*;
5use core::marker::{PhantomData, PhantomPinned};
6use core::ptr::NonNull;
7#[cfg(feature = "objc2")]
8use objc2::__framework_prelude::*;
9use objc2_core_foundation::*;
10
11use crate::*;
12
13extern "C" {
14 #[deprecated = "No longer supported"]
16 pub static kWSMethodInvocationResult: Option<&'static CFString>;
17}
18
19extern "C" {
20 #[deprecated = "No longer supported"]
22 pub static kWSFaultString: Option<&'static CFString>;
23}
24
25extern "C" {
26 #[deprecated = "No longer supported"]
28 pub static kWSFaultCode: Option<&'static CFString>;
29}
30
31extern "C" {
32 #[deprecated = "No longer supported"]
34 pub static kWSFaultExtra: Option<&'static CFString>;
35}
36
37extern "C" {
38 #[deprecated = "No longer supported"]
40 pub static kWSNetworkStreamFaultString: Option<&'static CFString>;
41}
42
43extern "C" {
44 #[deprecated = "No longer supported"]
46 pub static kWSStreamErrorMessage: Option<&'static CFString>;
47}
48
49extern "C" {
50 #[deprecated = "No longer supported"]
52 pub static kWSStreamErrorDomain: Option<&'static CFString>;
53}
54
55extern "C" {
56 #[deprecated = "No longer supported"]
58 pub static kWSStreamErrorError: Option<&'static CFString>;
59}
60
61extern "C" {
62 #[deprecated = "No longer supported"]
64 pub static kWSHTTPMessage: Option<&'static CFString>;
65}
66
67extern "C" {
68 #[deprecated = "No longer supported"]
70 pub static kWSHTTPResponseMessage: Option<&'static CFString>;
71}
72
73extern "C" {
74 #[deprecated = "No longer supported"]
76 pub static kWSHTTPExtraHeaders: Option<&'static CFString>;
77}
78
79extern "C" {
80 #[deprecated = "No longer supported"]
82 pub static kWSHTTPVersion: Option<&'static CFString>;
83}
84
85extern "C" {
86 #[deprecated = "No longer supported"]
88 pub static kWSHTTPProxy: Option<&'static CFString>;
89}
90
91extern "C" {
92 #[deprecated = "No longer supported"]
94 pub static kWSHTTPFollowsRedirects: Option<&'static CFString>;
95}
96
97extern "C" {
98 #[deprecated = "No longer supported"]
100 pub static kWSDebugOutgoingHeaders: Option<&'static CFString>;
101}
102
103extern "C" {
104 #[deprecated = "No longer supported"]
106 pub static kWSDebugOutgoingBody: Option<&'static CFString>;
107}
108
109extern "C" {
110 #[deprecated = "No longer supported"]
112 pub static kWSDebugIncomingHeaders: Option<&'static CFString>;
113}
114
115extern "C" {
116 #[deprecated = "No longer supported"]
118 pub static kWSDebugIncomingBody: Option<&'static CFString>;
119}
120
121extern "C" {
122 #[deprecated = "No longer supported"]
124 pub static kWSSOAPBodyEncodingStyle: Option<&'static CFString>;
125}
126
127extern "C" {
128 #[deprecated = "No longer supported"]
130 pub static kWSSOAPMethodNamespaceURI: Option<&'static CFString>;
131}
132
133extern "C" {
134 #[deprecated = "No longer supported"]
136 pub static kWSSOAPStyleDoc: Option<&'static CFString>;
137}
138
139extern "C" {
140 #[deprecated = "No longer supported"]
142 pub static kWSSOAPStyleRPC: Option<&'static CFString>;
143}
144
145extern "C" {
146 #[deprecated = "No longer supported"]
148 pub static kWSSOAPMessageHeaders: Option<&'static CFString>;
149}
150
151extern "C" {
152 #[deprecated = "No longer supported"]
154 pub static kWSRecordParameterOrder: Option<&'static CFString>;
155}
156
157extern "C" {
158 #[deprecated = "No longer supported"]
160 pub static kWSRecordNamespaceURI: Option<&'static CFString>;
161}
162
163extern "C" {
164 #[deprecated = "No longer supported"]
166 pub static kWSRecordType: Option<&'static CFString>;
167}
168
169extern "C" {
170 #[deprecated = "No longer supported"]
172 pub static kWSMethodInvocationResultParameterName: Option<&'static CFString>;
173}
174
175extern "C" {
176 #[deprecated = "No longer supported"]
178 pub static kWSMethodInvocationTimeoutValue: Option<&'static CFString>;
179}
180
181#[doc(alias = "WSMethodInvocationRef")]
183#[repr(C)]
184pub struct WSMethodInvocation {
185 inner: [u8; 0],
186 _p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
187}
188
189cf_type!(
190 unsafe impl WSMethodInvocation {}
191);
192#[cfg(feature = "objc2")]
193cf_objc2_type!(
194 unsafe impl RefEncode<"OpaqueWSMethodInvocationRef"> for WSMethodInvocation {}
195);
196
197unsafe impl ConcreteType for WSMethodInvocation {
198 #[doc(alias = "WSMethodInvocationGetTypeID")]
199 #[inline]
200 fn type_id() -> CFTypeID {
201 extern "C-unwind" {
202 fn WSMethodInvocationGetTypeID() -> CFTypeID;
203 }
204 unsafe { WSMethodInvocationGetTypeID() }
205 }
206}
207
208impl WSMethodInvocation {
209 #[doc(alias = "WSMethodInvocationCreate")]
215 #[deprecated = "No longer supported"]
216 #[inline]
217 pub unsafe fn new(
218 url: Option<&CFURL>,
219 method_name: Option<&CFString>,
220 protocol: Option<&CFString>,
221 ) -> Option<CFRetained<WSMethodInvocation>> {
222 extern "C-unwind" {
223 fn WSMethodInvocationCreate(
224 url: Option<&CFURL>,
225 method_name: Option<&CFString>,
226 protocol: Option<&CFString>,
227 ) -> Option<NonNull<WSMethodInvocation>>;
228 }
229 let ret = unsafe { WSMethodInvocationCreate(url, method_name, protocol) };
230 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
231 }
232
233 #[doc(alias = "WSMethodInvocationCreateFromSerialization")]
237 #[deprecated = "No longer supported"]
238 #[inline]
239 pub unsafe fn from_serialization(
240 contract: Option<&CFData>,
241 ) -> Option<CFRetained<WSMethodInvocation>> {
242 extern "C-unwind" {
243 fn WSMethodInvocationCreateFromSerialization(
244 contract: Option<&CFData>,
245 ) -> Option<NonNull<WSMethodInvocation>>;
246 }
247 let ret = unsafe { WSMethodInvocationCreateFromSerialization(contract) };
248 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
249 }
250
251 #[doc(alias = "WSMethodInvocationCopySerialization")]
252 #[deprecated = "No longer supported"]
253 #[inline]
254 pub unsafe fn serialization(&self) -> Option<CFRetained<CFData>> {
255 extern "C-unwind" {
256 fn WSMethodInvocationCopySerialization(
257 invocation: &WSMethodInvocation,
258 ) -> Option<NonNull<CFData>>;
259 }
260 let ret = unsafe { WSMethodInvocationCopySerialization(self) };
261 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
262 }
263
264 #[doc(alias = "WSMethodInvocationSetParameters")]
271 #[deprecated = "No longer supported"]
272 #[inline]
273 pub unsafe fn set_parameters(
274 &self,
275 parameters: Option<&CFDictionary>,
276 parameter_order: Option<&CFArray>,
277 ) {
278 extern "C-unwind" {
279 fn WSMethodInvocationSetParameters(
280 invocation: &WSMethodInvocation,
281 parameters: Option<&CFDictionary>,
282 parameter_order: Option<&CFArray>,
283 );
284 }
285 unsafe { WSMethodInvocationSetParameters(self, parameters, parameter_order) }
286 }
287
288 #[doc(alias = "WSMethodInvocationCopyParameters")]
292 #[deprecated = "No longer supported"]
293 #[inline]
294 pub unsafe fn parameters(
295 &self,
296 parameter_order: *mut *const CFArray,
297 ) -> Option<CFRetained<CFDictionary>> {
298 extern "C-unwind" {
299 fn WSMethodInvocationCopyParameters(
300 invocation: &WSMethodInvocation,
301 parameter_order: *mut *const CFArray,
302 ) -> Option<NonNull<CFDictionary>>;
303 }
304 let ret = unsafe { WSMethodInvocationCopyParameters(self, parameter_order) };
305 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
306 }
307
308 #[doc(alias = "WSMethodInvocationSetProperty")]
314 #[deprecated = "No longer supported"]
315 #[inline]
316 pub unsafe fn set_property(
317 &self,
318 property_name: Option<&CFString>,
319 property_value: Option<&CFType>,
320 ) {
321 extern "C-unwind" {
322 fn WSMethodInvocationSetProperty(
323 invocation: &WSMethodInvocation,
324 property_name: Option<&CFString>,
325 property_value: Option<&CFType>,
326 );
327 }
328 unsafe { WSMethodInvocationSetProperty(self, property_name, property_value) }
329 }
330
331 #[doc(alias = "WSMethodInvocationCopyProperty")]
335 #[deprecated = "No longer supported"]
336 #[inline]
337 pub unsafe fn property(&self, property_name: Option<&CFString>) -> Option<CFRetained<CFType>> {
338 extern "C-unwind" {
339 fn WSMethodInvocationCopyProperty(
340 invocation: &WSMethodInvocation,
341 property_name: Option<&CFString>,
342 ) -> Option<NonNull<CFType>>;
343 }
344 let ret = unsafe { WSMethodInvocationCopyProperty(self, property_name) };
345 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
346 }
347
348 #[doc(alias = "WSMethodInvocationInvoke")]
349 #[deprecated = "No longer supported"]
350 #[inline]
351 pub unsafe fn invoke(&self) -> Option<CFRetained<CFDictionary>> {
352 extern "C-unwind" {
353 fn WSMethodInvocationInvoke(
354 invocation: &WSMethodInvocation,
355 ) -> Option<NonNull<CFDictionary>>;
356 }
357 let ret = unsafe { WSMethodInvocationInvoke(self) };
358 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
359 }
360}
361
362#[deprecated = "No longer supported"]
364pub type WSMethodInvocationCallBackProcPtr =
365 Option<unsafe extern "C-unwind" fn(*mut WSMethodInvocation, *mut c_void, *const CFDictionary)>;
366
367impl WSMethodInvocation {
368 #[doc(alias = "WSMethodInvocationSetCallBack")]
373 #[cfg(feature = "WSTypes")]
374 #[deprecated = "No longer supported"]
375 #[inline]
376 pub unsafe fn set_call_back(
377 &self,
378 client_cb: WSMethodInvocationCallBackProcPtr,
379 context: *mut WSClientContext,
380 ) {
381 extern "C-unwind" {
382 fn WSMethodInvocationSetCallBack(
383 invocation: &WSMethodInvocation,
384 client_cb: WSMethodInvocationCallBackProcPtr,
385 context: *mut WSClientContext,
386 );
387 }
388 unsafe { WSMethodInvocationSetCallBack(self, client_cb, context) }
389 }
390
391 #[doc(alias = "WSMethodInvocationScheduleWithRunLoop")]
397 #[deprecated = "No longer supported"]
398 #[inline]
399 pub unsafe fn schedule_with_run_loop(
400 &self,
401 run_loop: Option<&CFRunLoop>,
402 run_loop_mode: Option<&CFString>,
403 ) {
404 extern "C-unwind" {
405 fn WSMethodInvocationScheduleWithRunLoop(
406 invocation: &WSMethodInvocation,
407 run_loop: Option<&CFRunLoop>,
408 run_loop_mode: Option<&CFString>,
409 );
410 }
411 unsafe { WSMethodInvocationScheduleWithRunLoop(self, run_loop, run_loop_mode) }
412 }
413
414 #[doc(alias = "WSMethodInvocationUnscheduleFromRunLoop")]
420 #[deprecated = "No longer supported"]
421 #[inline]
422 pub unsafe fn unschedule_from_run_loop(
423 &self,
424 run_loop: Option<&CFRunLoop>,
425 run_loop_mode: Option<&CFString>,
426 ) {
427 extern "C-unwind" {
428 fn WSMethodInvocationUnscheduleFromRunLoop(
429 invocation: &WSMethodInvocation,
430 run_loop: Option<&CFRunLoop>,
431 run_loop_mode: Option<&CFString>,
432 );
433 }
434 unsafe { WSMethodInvocationUnscheduleFromRunLoop(self, run_loop, run_loop_mode) }
435 }
436}
437
438#[deprecated = "No longer supported"]
443#[inline]
444pub unsafe extern "C-unwind" fn WSMethodResultIsFault(
445 method_result: Option<&CFDictionary>,
446) -> bool {
447 extern "C-unwind" {
448 fn WSMethodResultIsFault(method_result: Option<&CFDictionary>) -> Boolean;
449 }
450 let ret = unsafe { WSMethodResultIsFault(method_result) };
451 ret != 0
452}
453
454#[deprecated = "No longer supported"]
456pub type WSMethodInvocationSerializationProcPtr = Option<
457 unsafe extern "C-unwind" fn(
458 *mut WSMethodInvocation,
459 *const CFType,
460 *mut c_void,
461 ) -> *const CFString,
462>;
463
464impl WSMethodInvocation {
465 #[doc(alias = "WSMethodInvocationAddSerializationOverride")]
470 #[cfg(feature = "WSTypes")]
471 #[deprecated = "No longer supported"]
472 #[inline]
473 pub unsafe fn add_serialization_override(
474 &self,
475 obj_type: CFTypeID,
476 serialization_proc: WSMethodInvocationSerializationProcPtr,
477 context: *mut WSClientContext,
478 ) {
479 extern "C-unwind" {
480 fn WSMethodInvocationAddSerializationOverride(
481 invocation: &WSMethodInvocation,
482 obj_type: CFTypeID,
483 serialization_proc: WSMethodInvocationSerializationProcPtr,
484 context: *mut WSClientContext,
485 );
486 }
487 unsafe {
488 WSMethodInvocationAddSerializationOverride(self, obj_type, serialization_proc, context)
489 }
490 }
491}
492
493#[deprecated = "No longer supported"]
495pub type WSMethodInvocationDeserializationProcPtr = Option<
496 unsafe extern "C-unwind" fn(
497 *mut WSMethodInvocation,
498 *mut CFXMLTree,
499 *mut CFXMLTree,
500 *mut c_void,
501 ) -> *const CFType,
502>;
503
504impl WSMethodInvocation {
505 #[doc(alias = "WSMethodInvocationAddDeserializationOverride")]
512 #[cfg(feature = "WSTypes")]
513 #[deprecated = "No longer supported"]
514 #[inline]
515 pub unsafe fn add_deserialization_override(
516 &self,
517 type_namespace: Option<&CFString>,
518 type_name: Option<&CFString>,
519 deserialization_proc: WSMethodInvocationDeserializationProcPtr,
520 context: *mut WSClientContext,
521 ) {
522 extern "C-unwind" {
523 fn WSMethodInvocationAddDeserializationOverride(
524 invocation: &WSMethodInvocation,
525 type_namespace: Option<&CFString>,
526 type_name: Option<&CFString>,
527 deserialization_proc: WSMethodInvocationDeserializationProcPtr,
528 context: *mut WSClientContext,
529 );
530 }
531 unsafe {
532 WSMethodInvocationAddDeserializationOverride(
533 self,
534 type_namespace,
535 type_name,
536 deserialization_proc,
537 context,
538 )
539 }
540 }
541}
542
543#[deprecated = "renamed to `WSMethodInvocation::new`"]
544#[inline]
545pub unsafe extern "C-unwind" fn WSMethodInvocationCreate(
546 url: Option<&CFURL>,
547 method_name: Option<&CFString>,
548 protocol: Option<&CFString>,
549) -> Option<CFRetained<WSMethodInvocation>> {
550 extern "C-unwind" {
551 fn WSMethodInvocationCreate(
552 url: Option<&CFURL>,
553 method_name: Option<&CFString>,
554 protocol: Option<&CFString>,
555 ) -> Option<NonNull<WSMethodInvocation>>;
556 }
557 let ret = unsafe { WSMethodInvocationCreate(url, method_name, protocol) };
558 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
559}
560
561#[deprecated = "renamed to `WSMethodInvocation::from_serialization`"]
562#[inline]
563pub unsafe extern "C-unwind" fn WSMethodInvocationCreateFromSerialization(
564 contract: Option<&CFData>,
565) -> Option<CFRetained<WSMethodInvocation>> {
566 extern "C-unwind" {
567 fn WSMethodInvocationCreateFromSerialization(
568 contract: Option<&CFData>,
569 ) -> Option<NonNull<WSMethodInvocation>>;
570 }
571 let ret = unsafe { WSMethodInvocationCreateFromSerialization(contract) };
572 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
573}
574
575#[deprecated = "renamed to `WSMethodInvocation::serialization`"]
576#[inline]
577pub unsafe extern "C-unwind" fn WSMethodInvocationCopySerialization(
578 invocation: &WSMethodInvocation,
579) -> Option<CFRetained<CFData>> {
580 extern "C-unwind" {
581 fn WSMethodInvocationCopySerialization(
582 invocation: &WSMethodInvocation,
583 ) -> Option<NonNull<CFData>>;
584 }
585 let ret = unsafe { WSMethodInvocationCopySerialization(invocation) };
586 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
587}
588
589extern "C-unwind" {
590 #[deprecated = "renamed to `WSMethodInvocation::set_parameters`"]
591 pub fn WSMethodInvocationSetParameters(
592 invocation: &WSMethodInvocation,
593 parameters: Option<&CFDictionary>,
594 parameter_order: Option<&CFArray>,
595 );
596}
597
598#[deprecated = "renamed to `WSMethodInvocation::parameters`"]
599#[inline]
600pub unsafe extern "C-unwind" fn WSMethodInvocationCopyParameters(
601 invocation: &WSMethodInvocation,
602 parameter_order: *mut *const CFArray,
603) -> Option<CFRetained<CFDictionary>> {
604 extern "C-unwind" {
605 fn WSMethodInvocationCopyParameters(
606 invocation: &WSMethodInvocation,
607 parameter_order: *mut *const CFArray,
608 ) -> Option<NonNull<CFDictionary>>;
609 }
610 let ret = unsafe { WSMethodInvocationCopyParameters(invocation, parameter_order) };
611 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
612}
613
614extern "C-unwind" {
615 #[deprecated = "renamed to `WSMethodInvocation::set_property`"]
616 pub fn WSMethodInvocationSetProperty(
617 invocation: &WSMethodInvocation,
618 property_name: Option<&CFString>,
619 property_value: Option<&CFType>,
620 );
621}
622
623#[deprecated = "renamed to `WSMethodInvocation::property`"]
624#[inline]
625pub unsafe extern "C-unwind" fn WSMethodInvocationCopyProperty(
626 invocation: &WSMethodInvocation,
627 property_name: Option<&CFString>,
628) -> Option<CFRetained<CFType>> {
629 extern "C-unwind" {
630 fn WSMethodInvocationCopyProperty(
631 invocation: &WSMethodInvocation,
632 property_name: Option<&CFString>,
633 ) -> Option<NonNull<CFType>>;
634 }
635 let ret = unsafe { WSMethodInvocationCopyProperty(invocation, property_name) };
636 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
637}
638
639#[deprecated = "renamed to `WSMethodInvocation::invoke`"]
640#[inline]
641pub unsafe extern "C-unwind" fn WSMethodInvocationInvoke(
642 invocation: &WSMethodInvocation,
643) -> Option<CFRetained<CFDictionary>> {
644 extern "C-unwind" {
645 fn WSMethodInvocationInvoke(
646 invocation: &WSMethodInvocation,
647 ) -> Option<NonNull<CFDictionary>>;
648 }
649 let ret = unsafe { WSMethodInvocationInvoke(invocation) };
650 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
651}
652
653extern "C-unwind" {
654 #[cfg(feature = "WSTypes")]
655 #[deprecated = "renamed to `WSMethodInvocation::set_call_back`"]
656 pub fn WSMethodInvocationSetCallBack(
657 invocation: &WSMethodInvocation,
658 client_cb: WSMethodInvocationCallBackProcPtr,
659 context: *mut WSClientContext,
660 );
661}
662
663extern "C-unwind" {
664 #[deprecated = "renamed to `WSMethodInvocation::schedule_with_run_loop`"]
665 pub fn WSMethodInvocationScheduleWithRunLoop(
666 invocation: &WSMethodInvocation,
667 run_loop: Option<&CFRunLoop>,
668 run_loop_mode: Option<&CFString>,
669 );
670}
671
672extern "C-unwind" {
673 #[deprecated = "renamed to `WSMethodInvocation::unschedule_from_run_loop`"]
674 pub fn WSMethodInvocationUnscheduleFromRunLoop(
675 invocation: &WSMethodInvocation,
676 run_loop: Option<&CFRunLoop>,
677 run_loop_mode: Option<&CFString>,
678 );
679}
680
681extern "C-unwind" {
682 #[cfg(feature = "WSTypes")]
683 #[deprecated = "renamed to `WSMethodInvocation::add_serialization_override`"]
684 pub fn WSMethodInvocationAddSerializationOverride(
685 invocation: &WSMethodInvocation,
686 obj_type: CFTypeID,
687 serialization_proc: WSMethodInvocationSerializationProcPtr,
688 context: *mut WSClientContext,
689 );
690}
691
692extern "C-unwind" {
693 #[cfg(feature = "WSTypes")]
694 #[deprecated = "renamed to `WSMethodInvocation::add_deserialization_override`"]
695 pub fn WSMethodInvocationAddDeserializationOverride(
696 invocation: &WSMethodInvocation,
697 type_namespace: Option<&CFString>,
698 type_name: Option<&CFString>,
699 deserialization_proc: WSMethodInvocationDeserializationProcPtr,
700 context: *mut WSClientContext,
701 );
702}