objc2_foundation/generated/
NSCoder.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
9/// Describes the action an NSCoder should take when it encounters decode failures (e.g. corrupt data) for non-TopLevel decodes.
10///
11/// See also [Apple's documentation](https://developer.apple.com/documentation/foundation/nsdecodingfailurepolicy?language=objc)
12// NS_ENUM
13#[repr(transparent)]
14#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
15pub struct NSDecodingFailurePolicy(pub NSInteger);
16impl NSDecodingFailurePolicy {
17    #[doc(alias = "NSDecodingFailurePolicyRaiseException")]
18    pub const RaiseException: Self = Self(0);
19    #[doc(alias = "NSDecodingFailurePolicySetErrorAndReturn")]
20    pub const SetErrorAndReturn: Self = Self(1);
21}
22
23unsafe impl Encode for NSDecodingFailurePolicy {
24    const ENCODING: Encoding = NSInteger::ENCODING;
25}
26
27unsafe impl RefEncode for NSDecodingFailurePolicy {
28    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
29}
30
31extern_class!(
32    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nscoder?language=objc)
33    #[unsafe(super(NSObject))]
34    #[derive(Debug, PartialEq, Eq, Hash)]
35    pub struct NSCoder;
36);
37
38extern_conformance!(
39    unsafe impl NSObjectProtocol for NSCoder {}
40);
41
42impl NSCoder {
43    extern_methods!(
44        #[unsafe(method(encodeValueOfObjCType:at:))]
45        #[unsafe(method_family = none)]
46        pub unsafe fn encodeValueOfObjCType_at(
47            &self,
48            r#type: NonNull<c_char>,
49            addr: NonNull<c_void>,
50        );
51
52        #[cfg(feature = "NSData")]
53        #[unsafe(method(encodeDataObject:))]
54        #[unsafe(method_family = none)]
55        pub unsafe fn encodeDataObject(&self, data: &NSData);
56
57        #[cfg(feature = "NSData")]
58        #[unsafe(method(decodeDataObject))]
59        #[unsafe(method_family = none)]
60        pub unsafe fn decodeDataObject(&self) -> Option<Retained<NSData>>;
61
62        #[unsafe(method(decodeValueOfObjCType:at:size:))]
63        #[unsafe(method_family = none)]
64        pub unsafe fn decodeValueOfObjCType_at_size(
65            &self,
66            r#type: NonNull<c_char>,
67            data: NonNull<c_void>,
68            size: NSUInteger,
69        );
70
71        #[cfg(feature = "NSString")]
72        #[unsafe(method(versionForClassName:))]
73        #[unsafe(method_family = none)]
74        pub unsafe fn versionForClassName(&self, class_name: &NSString) -> NSInteger;
75    );
76}
77
78/// Methods declared on superclass `NSObject`.
79impl NSCoder {
80    extern_methods!(
81        #[unsafe(method(init))]
82        #[unsafe(method_family = init)]
83        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
84
85        #[unsafe(method(new))]
86        #[unsafe(method_family = new)]
87        pub unsafe fn new() -> Retained<Self>;
88    );
89}
90
91/// NSExtendedCoder.
92impl NSCoder {
93    extern_methods!(
94        #[unsafe(method(encodeObject:))]
95        #[unsafe(method_family = none)]
96        pub unsafe fn encodeObject(&self, object: Option<&AnyObject>);
97
98        #[unsafe(method(encodeRootObject:))]
99        #[unsafe(method_family = none)]
100        pub unsafe fn encodeRootObject(&self, root_object: &AnyObject);
101
102        #[unsafe(method(encodeBycopyObject:))]
103        #[unsafe(method_family = none)]
104        pub unsafe fn encodeBycopyObject(&self, an_object: Option<&AnyObject>);
105
106        #[unsafe(method(encodeByrefObject:))]
107        #[unsafe(method_family = none)]
108        pub unsafe fn encodeByrefObject(&self, an_object: Option<&AnyObject>);
109
110        #[unsafe(method(encodeConditionalObject:))]
111        #[unsafe(method_family = none)]
112        pub unsafe fn encodeConditionalObject(&self, object: Option<&AnyObject>);
113
114        #[unsafe(method(encodeArrayOfObjCType:count:at:))]
115        #[unsafe(method_family = none)]
116        pub unsafe fn encodeArrayOfObjCType_count_at(
117            &self,
118            r#type: NonNull<c_char>,
119            count: NSUInteger,
120            array: NonNull<c_void>,
121        );
122
123        #[unsafe(method(encodeBytes:length:))]
124        #[unsafe(method_family = none)]
125        pub unsafe fn encodeBytes_length(&self, byteaddr: *const c_void, length: NSUInteger);
126
127        #[unsafe(method(decodeObject))]
128        #[unsafe(method_family = none)]
129        pub unsafe fn decodeObject(&self) -> Option<Retained<AnyObject>>;
130
131        #[cfg(feature = "NSError")]
132        #[unsafe(method(decodeTopLevelObjectAndReturnError:_))]
133        #[unsafe(method_family = none)]
134        pub unsafe fn decodeTopLevelObjectAndReturnError(
135            &self,
136        ) -> Result<Retained<AnyObject>, Retained<NSError>>;
137
138        #[unsafe(method(decodeArrayOfObjCType:count:at:))]
139        #[unsafe(method_family = none)]
140        pub unsafe fn decodeArrayOfObjCType_count_at(
141            &self,
142            item_type: NonNull<c_char>,
143            count: NSUInteger,
144            array: NonNull<c_void>,
145        );
146
147        #[unsafe(method(decodeBytesWithReturnedLength:))]
148        #[unsafe(method_family = none)]
149        pub unsafe fn decodeBytesWithReturnedLength(
150            &self,
151            lengthp: NonNull<NSUInteger>,
152        ) -> *mut c_void;
153
154        #[unsafe(method(encodePropertyList:))]
155        #[unsafe(method_family = none)]
156        pub unsafe fn encodePropertyList(&self, a_property_list: &AnyObject);
157
158        #[unsafe(method(decodePropertyList))]
159        #[unsafe(method_family = none)]
160        pub unsafe fn decodePropertyList(&self) -> Option<Retained<AnyObject>>;
161
162        #[cfg(feature = "NSZone")]
163        #[unsafe(method(setObjectZone:))]
164        #[unsafe(method_family = none)]
165        pub unsafe fn setObjectZone(&self, zone: *mut NSZone);
166
167        #[cfg(feature = "NSZone")]
168        #[unsafe(method(objectZone))]
169        #[unsafe(method_family = none)]
170        pub unsafe fn objectZone(&self) -> *mut NSZone;
171
172        #[unsafe(method(systemVersion))]
173        #[unsafe(method_family = none)]
174        pub unsafe fn systemVersion(&self) -> c_uint;
175
176        #[unsafe(method(allowsKeyedCoding))]
177        #[unsafe(method_family = none)]
178        pub unsafe fn allowsKeyedCoding(&self) -> bool;
179
180        #[cfg(feature = "NSString")]
181        #[unsafe(method(encodeObject:forKey:))]
182        #[unsafe(method_family = none)]
183        pub unsafe fn encodeObject_forKey(&self, object: Option<&AnyObject>, key: &NSString);
184
185        #[cfg(feature = "NSString")]
186        #[unsafe(method(encodeConditionalObject:forKey:))]
187        #[unsafe(method_family = none)]
188        pub unsafe fn encodeConditionalObject_forKey(
189            &self,
190            object: Option<&AnyObject>,
191            key: &NSString,
192        );
193
194        #[cfg(feature = "NSString")]
195        #[unsafe(method(encodeBool:forKey:))]
196        #[unsafe(method_family = none)]
197        pub unsafe fn encodeBool_forKey(&self, value: bool, key: &NSString);
198
199        #[cfg(feature = "NSString")]
200        #[unsafe(method(encodeInt:forKey:))]
201        #[unsafe(method_family = none)]
202        pub unsafe fn encodeInt_forKey(&self, value: c_int, key: &NSString);
203
204        #[cfg(feature = "NSString")]
205        #[unsafe(method(encodeInt32:forKey:))]
206        #[unsafe(method_family = none)]
207        pub unsafe fn encodeInt32_forKey(&self, value: i32, key: &NSString);
208
209        #[cfg(feature = "NSString")]
210        #[unsafe(method(encodeInt64:forKey:))]
211        #[unsafe(method_family = none)]
212        pub unsafe fn encodeInt64_forKey(&self, value: i64, key: &NSString);
213
214        #[cfg(feature = "NSString")]
215        #[unsafe(method(encodeFloat:forKey:))]
216        #[unsafe(method_family = none)]
217        pub unsafe fn encodeFloat_forKey(&self, value: c_float, key: &NSString);
218
219        #[cfg(feature = "NSString")]
220        #[unsafe(method(encodeDouble:forKey:))]
221        #[unsafe(method_family = none)]
222        pub unsafe fn encodeDouble_forKey(&self, value: c_double, key: &NSString);
223
224        #[cfg(feature = "NSString")]
225        #[unsafe(method(encodeBytes:length:forKey:))]
226        #[unsafe(method_family = none)]
227        pub unsafe fn encodeBytes_length_forKey(
228            &self,
229            bytes: *const u8,
230            length: NSUInteger,
231            key: &NSString,
232        );
233
234        #[cfg(feature = "NSString")]
235        #[unsafe(method(containsValueForKey:))]
236        #[unsafe(method_family = none)]
237        pub unsafe fn containsValueForKey(&self, key: &NSString) -> bool;
238
239        #[cfg(feature = "NSString")]
240        #[unsafe(method(decodeObjectForKey:))]
241        #[unsafe(method_family = none)]
242        pub unsafe fn decodeObjectForKey(&self, key: &NSString) -> Option<Retained<AnyObject>>;
243
244        #[cfg(all(feature = "NSError", feature = "NSString"))]
245        #[unsafe(method(decodeTopLevelObjectForKey:error:_))]
246        #[unsafe(method_family = none)]
247        pub unsafe fn decodeTopLevelObjectForKey_error(
248            &self,
249            key: &NSString,
250        ) -> Result<Retained<AnyObject>, Retained<NSError>>;
251
252        #[cfg(feature = "NSString")]
253        #[unsafe(method(decodeBoolForKey:))]
254        #[unsafe(method_family = none)]
255        pub unsafe fn decodeBoolForKey(&self, key: &NSString) -> bool;
256
257        #[cfg(feature = "NSString")]
258        #[unsafe(method(decodeIntForKey:))]
259        #[unsafe(method_family = none)]
260        pub unsafe fn decodeIntForKey(&self, key: &NSString) -> c_int;
261
262        #[cfg(feature = "NSString")]
263        #[unsafe(method(decodeInt32ForKey:))]
264        #[unsafe(method_family = none)]
265        pub unsafe fn decodeInt32ForKey(&self, key: &NSString) -> i32;
266
267        #[cfg(feature = "NSString")]
268        #[unsafe(method(decodeInt64ForKey:))]
269        #[unsafe(method_family = none)]
270        pub unsafe fn decodeInt64ForKey(&self, key: &NSString) -> i64;
271
272        #[cfg(feature = "NSString")]
273        #[unsafe(method(decodeFloatForKey:))]
274        #[unsafe(method_family = none)]
275        pub unsafe fn decodeFloatForKey(&self, key: &NSString) -> c_float;
276
277        #[cfg(feature = "NSString")]
278        #[unsafe(method(decodeDoubleForKey:))]
279        #[unsafe(method_family = none)]
280        pub unsafe fn decodeDoubleForKey(&self, key: &NSString) -> c_double;
281
282        #[cfg(feature = "NSString")]
283        #[unsafe(method(decodeBytesForKey:returnedLength:))]
284        #[unsafe(method_family = none)]
285        pub unsafe fn decodeBytesForKey_returnedLength(
286            &self,
287            key: &NSString,
288            lengthp: *mut NSUInteger,
289        ) -> *const u8;
290
291        /// Decode bytes from the decoder. The length of the bytes must be greater than or equal to the `length` parameter.
292        /// If the result exists, but is of insufficient length, then the decoder uses `failWithError` to fail the entire decode operation. The result of that is configurable on a per-NSCoder basis using `NSDecodingFailurePolicy`.
293        #[unsafe(method(decodeBytesWithMinimumLength:))]
294        #[unsafe(method_family = none)]
295        pub unsafe fn decodeBytesWithMinimumLength(&self, length: NSUInteger) -> *mut c_void;
296
297        #[cfg(feature = "NSString")]
298        /// Decode bytes from the decoder for a given key. The length of the bytes must be greater than or equal to the `length` parameter.
299        /// If the result exists, but is of insufficient length, then the decoder uses `failWithError` to fail the entire decode operation. The result of that is configurable on a per-NSCoder basis using `NSDecodingFailurePolicy`.
300        #[unsafe(method(decodeBytesForKey:minimumLength:))]
301        #[unsafe(method_family = none)]
302        pub unsafe fn decodeBytesForKey_minimumLength(
303            &self,
304            key: &NSString,
305            length: NSUInteger,
306        ) -> *const u8;
307
308        #[cfg(feature = "NSString")]
309        #[unsafe(method(encodeInteger:forKey:))]
310        #[unsafe(method_family = none)]
311        pub unsafe fn encodeInteger_forKey(&self, value: NSInteger, key: &NSString);
312
313        #[cfg(feature = "NSString")]
314        #[unsafe(method(decodeIntegerForKey:))]
315        #[unsafe(method_family = none)]
316        pub unsafe fn decodeIntegerForKey(&self, key: &NSString) -> NSInteger;
317
318        #[unsafe(method(requiresSecureCoding))]
319        #[unsafe(method_family = none)]
320        pub unsafe fn requiresSecureCoding(&self) -> bool;
321
322        #[cfg(feature = "NSString")]
323        #[unsafe(method(decodeObjectOfClass:forKey:))]
324        #[unsafe(method_family = none)]
325        pub unsafe fn decodeObjectOfClass_forKey(
326            &self,
327            a_class: &AnyClass,
328            key: &NSString,
329        ) -> Option<Retained<AnyObject>>;
330
331        #[cfg(all(feature = "NSError", feature = "NSString"))]
332        #[unsafe(method(decodeTopLevelObjectOfClass:forKey:error:_))]
333        #[unsafe(method_family = none)]
334        pub unsafe fn decodeTopLevelObjectOfClass_forKey_error(
335            &self,
336            a_class: &AnyClass,
337            key: &NSString,
338        ) -> Result<Retained<AnyObject>, Retained<NSError>>;
339
340        #[cfg(all(feature = "NSArray", feature = "NSString"))]
341        /// Decodes the
342        /// `NSArray`object for the given
343        /// `key,`which should be an
344        /// `NSArray<cls>,`containing the given non-collection class (no nested arrays or arrays of dictionaries, etc) from the coder.
345        ///
346        /// Requires
347        /// `NSSecureCoding`otherwise an exception is thrown and sets the
348        /// `decodingFailurePolicy`to
349        /// `NSDecodingFailurePolicySetErrorAndReturn.`
350        /// Returns
351        /// `nil`if the object for
352        /// `key`is not of the expected types, or cannot be decoded, and sets the
353        /// `error`on the decoder.
354        #[unsafe(method(decodeArrayOfObjectsOfClass:forKey:))]
355        #[unsafe(method_family = none)]
356        pub unsafe fn decodeArrayOfObjectsOfClass_forKey(
357            &self,
358            cls: &AnyClass,
359            key: &NSString,
360        ) -> Option<Retained<NSArray>>;
361
362        #[cfg(all(feature = "NSDictionary", feature = "NSString"))]
363        /// Decodes the
364        /// `NSDictionary`object for the given
365        /// `key,`which should be an
366        /// `NSDictionary<keyCls,objectCls>`, with keys of type given in
367        /// `keyCls`and objects of the given non-collection class
368        /// `objectCls`(no nested dictionaries or other dictionaries contained in the dictionary, etc) from the coder.
369        ///
370        /// Requires
371        /// `NSSecureCoding`otherwise an exception is thrown and sets the
372        /// `decodingFailurePolicy`to
373        /// `NSDecodingFailurePolicySetErrorAndReturn.`
374        /// Returns
375        /// `nil`if the object for
376        /// `key`is not of the expected types, or cannot be decoded, and sets the
377        /// `error`on the decoder.
378        #[unsafe(method(decodeDictionaryWithKeysOfClass:objectsOfClass:forKey:))]
379        #[unsafe(method_family = none)]
380        pub unsafe fn decodeDictionaryWithKeysOfClass_objectsOfClass_forKey(
381            &self,
382            key_cls: &AnyClass,
383            object_cls: &AnyClass,
384            key: &NSString,
385        ) -> Option<Retained<NSDictionary>>;
386
387        #[cfg(all(feature = "NSSet", feature = "NSString"))]
388        #[unsafe(method(decodeObjectOfClasses:forKey:))]
389        #[unsafe(method_family = none)]
390        pub unsafe fn decodeObjectOfClasses_forKey(
391            &self,
392            classes: Option<&NSSet<AnyClass>>,
393            key: &NSString,
394        ) -> Option<Retained<AnyObject>>;
395
396        #[cfg(all(feature = "NSError", feature = "NSSet", feature = "NSString"))]
397        #[unsafe(method(decodeTopLevelObjectOfClasses:forKey:error:_))]
398        #[unsafe(method_family = none)]
399        pub unsafe fn decodeTopLevelObjectOfClasses_forKey_error(
400            &self,
401            classes: Option<&NSSet<AnyClass>>,
402            key: &NSString,
403        ) -> Result<Retained<AnyObject>, Retained<NSError>>;
404
405        #[cfg(all(feature = "NSArray", feature = "NSSet", feature = "NSString"))]
406        /// Decodes the
407        /// `NSArray`object for the given
408        /// `key,`which should be an
409        /// `NSArray,`containing the given non-collection classes (no nested arrays or arrays of dictionaries, etc) from the coder.
410        ///
411        /// Requires
412        /// `NSSecureCoding`otherwise an exception is thrown and sets the
413        /// `decodingFailurePolicy`to
414        /// `NSDecodingFailurePolicySetErrorAndReturn.`
415        /// Returns
416        /// `nil`if the object for
417        /// `key`is not of the expected types, or cannot be decoded, and sets the
418        /// `error`on the decoder.
419        #[unsafe(method(decodeArrayOfObjectsOfClasses:forKey:))]
420        #[unsafe(method_family = none)]
421        pub unsafe fn decodeArrayOfObjectsOfClasses_forKey(
422            &self,
423            classes: &NSSet<AnyClass>,
424            key: &NSString,
425        ) -> Option<Retained<NSArray>>;
426
427        #[cfg(all(feature = "NSDictionary", feature = "NSSet", feature = "NSString"))]
428        /// Decodes the
429        /// `NSDictionary`object for the given
430        /// `key,`which should be an
431        /// `NSDictionary,`with keys of the types given in
432        /// `keyClasses`and objects of the given non-collection classes in
433        /// `objectClasses`(no nested dictionaries or other dictionaries contained in the dictionary, etc) from the given coder.
434        ///
435        /// Requires
436        /// `NSSecureCoding`otherwise an exception is thrown and sets the
437        /// `decodingFailurePolicy`to
438        /// `NSDecodingFailurePolicySetErrorAndReturn.`
439        /// Returns
440        /// `nil`if the object for
441        /// `key`is not of the expected types, or cannot be decoded, and sets the
442        /// `error`on the decoder.
443        #[unsafe(method(decodeDictionaryWithKeysOfClasses:objectsOfClasses:forKey:))]
444        #[unsafe(method_family = none)]
445        pub unsafe fn decodeDictionaryWithKeysOfClasses_objectsOfClasses_forKey(
446            &self,
447            key_classes: &NSSet<AnyClass>,
448            object_classes: &NSSet<AnyClass>,
449            key: &NSString,
450        ) -> Option<Retained<NSDictionary>>;
451
452        #[cfg(feature = "NSString")]
453        #[unsafe(method(decodePropertyListForKey:))]
454        #[unsafe(method_family = none)]
455        pub unsafe fn decodePropertyListForKey(
456            &self,
457            key: &NSString,
458        ) -> Option<Retained<AnyObject>>;
459
460        #[cfg(feature = "NSSet")]
461        #[unsafe(method(allowedClasses))]
462        #[unsafe(method_family = none)]
463        pub unsafe fn allowedClasses(&self) -> Option<Retained<NSSet<AnyClass>>>;
464
465        #[cfg(feature = "NSError")]
466        /// Signals to this coder that the decode has failed.
467        /// Parameter non-nil error that describes the reason why the decode failed
468        ///
469        /// Sets an error on this NSCoder once per TopLevel decode; calling it repeatedly will have no effect until the call stack unwinds to one of the TopLevel decode entry-points.
470        ///
471        /// This method is only meaningful to call for decodes.
472        ///
473        /// Typically, you would want to call this method in your -initWithCoder: implementation when you detect situations like:
474        /// - lack of secure coding
475        /// - corruption of your data
476        /// - domain validation failures
477        ///
478        /// After calling -failWithError: within your -initWithCoder: implementation, you should clean up and return nil as early as possible.
479        ///
480        /// Once an error has been signaled to a decoder, it remains set until it has handed off to the first TopLevel decode invocation above it.  For example, consider the following call graph:
481        /// A    -decodeTopLevelObjectForKey:error:
482        /// B        -initWithCoder:
483        /// C            -decodeObjectForKey:
484        /// D                -initWithCoder:
485        /// E                    -decodeObjectForKey:
486        /// F                        -failWithError:
487        ///
488        /// In this case the error provided in stack-frame F will be returned via the outError in stack-frame A. Furthermore the result object from decodeTopLevelObjectForKey:error: will be nil, regardless of the result of stack-frame B.
489        ///
490        /// NSCoder implementations support two mechanisms for the stack-unwinding from F to A:
491        /// - forced (NSException based)
492        /// - particpatory (error based)
493        ///
494        /// The kind of unwinding you get is determined by the decodingFailurePolicy property of this NSCoder (which defaults to NSDecodingFailurePolicyRaiseException to match historical behavior).
495        #[unsafe(method(failWithError:))]
496        #[unsafe(method_family = none)]
497        pub unsafe fn failWithError(&self, error: &NSError);
498
499        /// Defines the behavior this NSCoder should take on decode failure (i.e. corrupt archive, invalid data, etc.).
500        ///
501        /// The default result of this property is NSDecodingFailurePolicyRaiseException, subclasses can change this to an alternative policy.
502        #[unsafe(method(decodingFailurePolicy))]
503        #[unsafe(method_family = none)]
504        pub unsafe fn decodingFailurePolicy(&self) -> NSDecodingFailurePolicy;
505
506        #[cfg(feature = "NSError")]
507        /// The current error (if there is one) for the current TopLevel decode.
508        ///
509        /// The meaning of this property changes based on the result of the decodingFailurePolicy property:
510        /// For NSDecodingFailurePolicyRaiseException, this property will always be nil.
511        /// For NSDecodingFailurePolicySetErrorAndReturn, this property can be non-nil, and if so, indicates that there was a failure while decoding the archive (specifically its the very first error encountered).
512        ///
513        /// While .error is non-nil, all attempts to decode data from this coder will return a nil/zero-equivalent value.
514        ///
515        /// This error is consumed by a TopLevel decode API (which resets this coder back to a being able to potentially decode data).
516        #[unsafe(method(error))]
517        #[unsafe(method_family = none)]
518        pub unsafe fn error(&self) -> Option<Retained<NSError>>;
519    );
520}
521
522#[deprecated = "Not supported"]
523#[inline]
524pub unsafe extern "C-unwind" fn NXReadNSObjectFromCoder(
525    decoder: &NSCoder,
526) -> Option<Retained<NSObject>> {
527    extern "C-unwind" {
528        fn NXReadNSObjectFromCoder(decoder: &NSCoder) -> *mut NSObject;
529    }
530    let ret = unsafe { NXReadNSObjectFromCoder(decoder) };
531    unsafe { Retained::retain_autoreleased(ret) }
532}
533
534/// NSTypedstreamCompatibility.
535impl NSCoder {
536    extern_methods!(
537        #[deprecated = "Not supported"]
538        #[unsafe(method(encodeNXObject:))]
539        #[unsafe(method_family = none)]
540        pub unsafe fn encodeNXObject(&self, object: &AnyObject);
541
542        #[deprecated = "Not supported"]
543        #[unsafe(method(decodeNXObject))]
544        #[unsafe(method_family = none)]
545        pub unsafe fn decodeNXObject(&self) -> Option<Retained<AnyObject>>;
546    );
547}
548
549/// NSDeprecated.
550impl NSCoder {
551    extern_methods!(
552        #[deprecated]
553        #[unsafe(method(decodeValueOfObjCType:at:))]
554        #[unsafe(method_family = none)]
555        pub unsafe fn decodeValueOfObjCType_at(
556            &self,
557            r#type: NonNull<c_char>,
558            data: NonNull<c_void>,
559        );
560    );
561}