Struct objc2_foundation::NSKeyedUnarchiver
source · #[repr(C)]pub struct NSKeyedUnarchiver { /* private fields */ }
Available on crate features
NSCoder
and NSKeyedArchiver
only.Implementations§
source§impl NSKeyedUnarchiver
impl NSKeyedUnarchiver
pub unsafe fn initForReadingFromData_error( this: Allocated<Self>, data: &NSData ) -> Result<Retained<Self>, Retained<NSError>>
Available on crate features
NSData
and NSError
only.pub unsafe fn unarchivedObjectOfClass_fromData_error( cls: &AnyClass, data: &NSData ) -> Result<Retained<AnyObject>, Retained<NSError>>
Available on crate features
NSData
and NSError
only.pub unsafe fn unarchivedArrayOfObjectsOfClass_fromData_error( cls: &AnyClass, data: &NSData ) -> Result<Retained<NSArray>, Retained<NSError>>
Available on crate features
NSArray
and NSData
and NSError
only.pub unsafe fn unarchivedDictionaryWithKeysOfClass_objectsOfClass_fromData_error( key_cls: &AnyClass, value_cls: &AnyClass, data: &NSData ) -> Result<Retained<NSDictionary>, Retained<NSError>>
Available on crate features
NSData
and NSDictionary
and NSError
only.pub unsafe fn unarchivedObjectOfClasses_fromData_error( classes: &NSSet<TodoClass>, data: &NSData ) -> Result<Retained<AnyObject>, Retained<NSError>>
Available on crate features
NSData
and NSError
and NSSet
only.pub unsafe fn unarchivedArrayOfObjectsOfClasses_fromData_error( classes: &NSSet<TodoClass>, data: &NSData ) -> Result<Retained<NSArray>, Retained<NSError>>
Available on crate features
NSArray
and NSData
and NSError
and NSSet
only.pub unsafe fn unarchivedDictionaryWithKeysOfClasses_objectsOfClasses_fromData_error( key_classes: &NSSet<TodoClass>, value_classes: &NSSet<TodoClass>, data: &NSData ) -> Result<Retained<NSDictionary>, Retained<NSError>>
Available on crate features
NSData
and NSDictionary
and NSError
and NSSet
only.pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>
👎Deprecated: Use -initForReadingFromData:error: instead
pub unsafe fn initForReadingWithData( this: Allocated<Self>, data: &NSData ) -> Retained<Self>
👎Deprecated: Use -initForReadingFromData:error: instead
Available on crate feature
NSData
only.pub unsafe fn unarchiveObjectWithData( data: &NSData ) -> Option<Retained<AnyObject>>
👎Deprecated: Use +unarchivedObjectOfClass:fromData:error: instead
Available on crate feature
NSData
only.pub unsafe fn unarchiveTopLevelObjectWithData_error( data: &NSData ) -> Result<Retained<AnyObject>, Retained<NSError>>
👎Deprecated: Use +unarchivedObjectOfClass:fromData:error: instead
Available on crate features
NSData
and NSError
only.pub unsafe fn unarchiveObjectWithFile( path: &NSString ) -> Option<Retained<AnyObject>>
👎Deprecated: Use +unarchivedObjectOfClass:fromData:error: instead
Available on crate feature
NSString
only.pub unsafe fn delegate( &self ) -> Option<Retained<ProtocolObject<dyn NSKeyedUnarchiverDelegate>>>
pub unsafe fn setDelegate( &self, delegate: Option<&ProtocolObject<dyn NSKeyedUnarchiverDelegate>> )
pub unsafe fn finishDecoding(&self)
pub unsafe fn setClass_forClassName_class( cls: Option<&AnyClass>, coded_name: &NSString )
Available on crate feature
NSString
only.pub unsafe fn setClass_forClassName( &self, cls: Option<&AnyClass>, coded_name: &NSString )
Available on crate feature
NSString
only.pub unsafe fn classForClassName_class( coded_name: &NSString ) -> Option<&'static AnyClass>
Available on crate feature
NSString
only.pub unsafe fn classForClassName( &self, coded_name: &NSString ) -> Option<&'static AnyClass>
Available on crate feature
NSString
only.pub unsafe fn containsValueForKey(&self, key: &NSString) -> bool
Available on crate feature
NSString
only.pub unsafe fn decodeObjectForKey( &self, key: &NSString ) -> Option<Retained<AnyObject>>
Available on crate feature
NSString
only.pub unsafe fn decodeBoolForKey(&self, key: &NSString) -> bool
Available on crate feature
NSString
only.pub unsafe fn decodeIntForKey(&self, key: &NSString) -> c_int
Available on crate feature
NSString
only.pub unsafe fn decodeInt32ForKey(&self, key: &NSString) -> i32
Available on crate feature
NSString
only.pub unsafe fn decodeInt64ForKey(&self, key: &NSString) -> i64
Available on crate feature
NSString
only.pub unsafe fn decodeFloatForKey(&self, key: &NSString) -> c_float
Available on crate feature
NSString
only.pub unsafe fn decodeDoubleForKey(&self, key: &NSString) -> c_double
Available on crate feature
NSString
only.pub unsafe fn decodeBytesForKey_returnedLength( &self, key: &NSString, lengthp: *mut NSUInteger ) -> *mut u8
Available on crate feature
NSString
only.pub unsafe fn requiresSecureCoding(&self) -> bool
pub unsafe fn setRequiresSecureCoding(&self, requires_secure_coding: bool)
pub unsafe fn decodingFailurePolicy(&self) -> NSDecodingFailurePolicy
pub unsafe fn setDecodingFailurePolicy( &self, decoding_failure_policy: NSDecodingFailurePolicy )
Methods from Deref<Target = NSCoder>§
pub unsafe fn encodeValueOfObjCType_at( &self, type: NonNull<c_char>, addr: NonNull<c_void> )
pub unsafe fn encodeDataObject(&self, data: &NSData)
Available on crate feature
NSData
only.pub unsafe fn decodeDataObject(&self) -> Option<Retained<NSData>>
Available on crate feature
NSData
only.pub unsafe fn decodeValueOfObjCType_at_size( &self, type: NonNull<c_char>, data: NonNull<c_void>, size: NSUInteger )
pub unsafe fn versionForClassName(&self, class_name: &NSString) -> NSInteger
Available on crate feature
NSString
only.pub unsafe fn encodeObject(&self, object: Option<&AnyObject>)
pub unsafe fn encodeRootObject(&self, root_object: &AnyObject)
pub unsafe fn encodeBycopyObject(&self, an_object: Option<&AnyObject>)
pub unsafe fn encodeByrefObject(&self, an_object: Option<&AnyObject>)
pub unsafe fn encodeConditionalObject(&self, object: Option<&AnyObject>)
pub unsafe fn encodeArrayOfObjCType_count_at( &self, type: NonNull<c_char>, count: NSUInteger, array: NonNull<c_void> )
pub unsafe fn encodeBytes_length( &self, byteaddr: *mut c_void, length: NSUInteger )
pub unsafe fn decodeObject(&self) -> Option<Retained<AnyObject>>
pub unsafe fn decodeTopLevelObjectAndReturnError( &self ) -> Result<Retained<AnyObject>, Retained<NSError>>
Available on crate feature
NSError
only.pub unsafe fn decodeArrayOfObjCType_count_at( &self, item_type: NonNull<c_char>, count: NSUInteger, array: NonNull<c_void> )
pub unsafe fn decodeBytesWithReturnedLength( &self, lengthp: NonNull<NSUInteger> ) -> *mut c_void
pub unsafe fn encodePropertyList(&self, a_property_list: &AnyObject)
pub unsafe fn decodePropertyList(&self) -> Option<Retained<AnyObject>>
pub unsafe fn setObjectZone(&self, zone: *mut NSZone)
Available on crate feature
NSZone
only.pub unsafe fn objectZone(&self) -> *mut NSZone
Available on crate feature
NSZone
only.pub unsafe fn systemVersion(&self) -> c_uint
pub unsafe fn allowsKeyedCoding(&self) -> bool
pub unsafe fn encodeObject_forKey( &self, object: Option<&AnyObject>, key: &NSString )
Available on crate feature
NSString
only.pub unsafe fn encodeConditionalObject_forKey( &self, object: Option<&AnyObject>, key: &NSString )
Available on crate feature
NSString
only.pub unsafe fn encodeBool_forKey(&self, value: bool, key: &NSString)
Available on crate feature
NSString
only.pub unsafe fn encodeInt_forKey(&self, value: c_int, key: &NSString)
Available on crate feature
NSString
only.pub unsafe fn encodeInt32_forKey(&self, value: i32, key: &NSString)
Available on crate feature
NSString
only.pub unsafe fn encodeInt64_forKey(&self, value: i64, key: &NSString)
Available on crate feature
NSString
only.pub unsafe fn encodeFloat_forKey(&self, value: c_float, key: &NSString)
Available on crate feature
NSString
only.pub unsafe fn encodeDouble_forKey(&self, value: c_double, key: &NSString)
Available on crate feature
NSString
only.pub unsafe fn encodeBytes_length_forKey( &self, bytes: *mut u8, length: NSUInteger, key: &NSString )
Available on crate feature
NSString
only.pub unsafe fn containsValueForKey(&self, key: &NSString) -> bool
Available on crate feature
NSString
only.pub unsafe fn decodeObjectForKey( &self, key: &NSString ) -> Option<Retained<AnyObject>>
Available on crate feature
NSString
only.pub unsafe fn decodeTopLevelObjectForKey_error( &self, key: &NSString ) -> Result<Retained<AnyObject>, Retained<NSError>>
Available on crate features
NSError
and NSString
only.pub unsafe fn decodeBoolForKey(&self, key: &NSString) -> bool
Available on crate feature
NSString
only.pub unsafe fn decodeIntForKey(&self, key: &NSString) -> c_int
Available on crate feature
NSString
only.pub unsafe fn decodeInt32ForKey(&self, key: &NSString) -> i32
Available on crate feature
NSString
only.pub unsafe fn decodeInt64ForKey(&self, key: &NSString) -> i64
Available on crate feature
NSString
only.pub unsafe fn decodeFloatForKey(&self, key: &NSString) -> c_float
Available on crate feature
NSString
only.pub unsafe fn decodeDoubleForKey(&self, key: &NSString) -> c_double
Available on crate feature
NSString
only.pub unsafe fn decodeBytesForKey_returnedLength( &self, key: &NSString, lengthp: *mut NSUInteger ) -> *mut u8
Available on crate feature
NSString
only.pub unsafe fn encodeInteger_forKey(&self, value: NSInteger, key: &NSString)
Available on crate feature
NSString
only.pub unsafe fn decodeIntegerForKey(&self, key: &NSString) -> NSInteger
Available on crate feature
NSString
only.pub unsafe fn requiresSecureCoding(&self) -> bool
pub unsafe fn decodeObjectOfClass_forKey( &self, a_class: &AnyClass, key: &NSString ) -> Option<Retained<AnyObject>>
Available on crate feature
NSString
only.pub unsafe fn decodeTopLevelObjectOfClass_forKey_error( &self, a_class: &AnyClass, key: &NSString ) -> Result<Retained<AnyObject>, Retained<NSError>>
Available on crate features
NSError
and NSString
only.pub unsafe fn decodeArrayOfObjectsOfClass_forKey( &self, cls: &AnyClass, key: &NSString ) -> Option<Retained<NSArray>>
Available on crate features
NSArray
and NSString
only.pub unsafe fn decodeDictionaryWithKeysOfClass_objectsOfClass_forKey( &self, key_cls: &AnyClass, object_cls: &AnyClass, key: &NSString ) -> Option<Retained<NSDictionary>>
Available on crate features
NSDictionary
and NSString
only.pub unsafe fn decodeObjectOfClasses_forKey( &self, classes: Option<&NSSet<TodoClass>>, key: &NSString ) -> Option<Retained<AnyObject>>
Available on crate features
NSSet
and NSString
only.pub unsafe fn decodeTopLevelObjectOfClasses_forKey_error( &self, classes: Option<&NSSet<TodoClass>>, key: &NSString ) -> Result<Retained<AnyObject>, Retained<NSError>>
Available on crate features
NSError
and NSSet
and NSString
only.pub unsafe fn decodeArrayOfObjectsOfClasses_forKey( &self, classes: &NSSet<TodoClass>, key: &NSString ) -> Option<Retained<NSArray>>
Available on crate features
NSArray
and NSSet
and NSString
only.pub unsafe fn decodeDictionaryWithKeysOfClasses_objectsOfClasses_forKey( &self, key_classes: &NSSet<TodoClass>, object_classes: &NSSet<TodoClass>, key: &NSString ) -> Option<Retained<NSDictionary>>
Available on crate features
NSDictionary
and NSSet
and NSString
only.pub unsafe fn decodePropertyListForKey( &self, key: &NSString ) -> Option<Retained<AnyObject>>
Available on crate feature
NSString
only.pub unsafe fn allowedClasses(&self) -> Option<Retained<NSSet<TodoClass>>>
Available on crate feature
NSSet
only.pub unsafe fn failWithError(&self, error: &NSError)
Available on crate feature
NSError
only.pub unsafe fn decodingFailurePolicy(&self) -> NSDecodingFailurePolicy
pub unsafe fn error(&self) -> Option<Retained<NSError>>
Available on crate feature
NSError
only.pub unsafe fn encodeNXObject(&self, object: &AnyObject)
👎Deprecated: Not supported
pub unsafe fn decodeNXObject(&self) -> Option<Retained<AnyObject>>
👎Deprecated: Not supported
pub unsafe fn decodeValueOfObjCType_at( &self, type: NonNull<c_char>, data: NonNull<c_void> )
👎Deprecated
pub unsafe fn encodePoint(&self, point: NSPoint)
Available on crate feature
NSGeometry
only.pub unsafe fn decodePoint(&self) -> NSPoint
Available on crate feature
NSGeometry
only.pub unsafe fn encodeSize(&self, size: NSSize)
Available on crate feature
NSGeometry
only.pub unsafe fn decodeSize(&self) -> NSSize
Available on crate feature
NSGeometry
only.pub unsafe fn encodeRect(&self, rect: NSRect)
Available on crate feature
NSGeometry
only.pub unsafe fn decodeRect(&self) -> NSRect
Available on crate feature
NSGeometry
only.pub unsafe fn encodePoint_forKey(&self, point: NSPoint, key: &NSString)
Available on crate features
NSGeometry
and NSString
only.pub unsafe fn encodeSize_forKey(&self, size: NSSize, key: &NSString)
Available on crate features
NSGeometry
and NSString
only.pub unsafe fn encodeRect_forKey(&self, rect: NSRect, key: &NSString)
Available on crate features
NSGeometry
and NSString
only.pub unsafe fn decodePointForKey(&self, key: &NSString) -> NSPoint
Available on crate features
NSGeometry
and NSString
only.pub unsafe fn decodeSizeForKey(&self, key: &NSString) -> NSSize
Available on crate features
NSGeometry
and NSString
only.pub unsafe fn decodeRectForKey(&self, key: &NSString) -> NSRect
Available on crate features
NSGeometry
and NSString
only.Methods from Deref<Target = NSObject>§
sourcepub fn doesNotRecognizeSelector(&self, sel: Sel) -> !
pub fn doesNotRecognizeSelector(&self, sel: Sel) -> !
Handle messages the object doesn’t recognize.
See Apple’s documentation for details.
Methods from Deref<Target = AnyObject>§
sourcepub fn class(&self) -> &'static AnyClass
pub fn class(&self) -> &'static AnyClass
Dynamically find the class of this object.
§Example
Check that an instance of NSObject
has the precise class NSObject
.
use objc2::ClassType;
use objc2::runtime::NSObject;
let obj = NSObject::new();
assert_eq!(obj.class(), NSObject::class());
sourcepub unsafe fn get_ivar<T>(&self, name: &str) -> &Twhere
T: Encode,
👎Deprecated: this is difficult to use correctly, use Ivar::load
instead.
pub unsafe fn get_ivar<T>(&self, name: &str) -> &Twhere
T: Encode,
Ivar::load
instead.Use Ivar::load
instead.
§Safety
The object must have an instance variable with the given name, and it
must be of type T
.
See Ivar::load_ptr
for details surrounding this.
sourcepub unsafe fn get_mut_ivar<T>(&mut self, name: &str) -> &mut Twhere
T: Encode,
👎Deprecated: this is difficult to use correctly, use Ivar::load_mut
instead.
pub unsafe fn get_mut_ivar<T>(&mut self, name: &str) -> &mut Twhere
T: Encode,
Ivar::load_mut
instead.Use Ivar::load_mut
instead.
§Safety
The object must have an instance variable with the given name, and it
must be of type T
.
See Ivar::load_ptr
for details surrounding this.
Trait Implementations§
source§impl AsMut<AnyObject> for NSKeyedUnarchiver
impl AsMut<AnyObject> for NSKeyedUnarchiver
source§impl AsMut<NSCoder> for NSKeyedUnarchiver
impl AsMut<NSCoder> for NSKeyedUnarchiver
source§impl AsMut<NSKeyedUnarchiver> for NSKeyedUnarchiver
impl AsMut<NSKeyedUnarchiver> for NSKeyedUnarchiver
source§impl AsMut<NSObject> for NSKeyedUnarchiver
impl AsMut<NSObject> for NSKeyedUnarchiver
source§impl AsRef<AnyObject> for NSKeyedUnarchiver
impl AsRef<AnyObject> for NSKeyedUnarchiver
source§impl AsRef<NSCoder> for NSKeyedUnarchiver
impl AsRef<NSCoder> for NSKeyedUnarchiver
source§impl AsRef<NSKeyedUnarchiver> for NSKeyedUnarchiver
impl AsRef<NSKeyedUnarchiver> for NSKeyedUnarchiver
source§impl AsRef<NSObject> for NSKeyedUnarchiver
impl AsRef<NSObject> for NSKeyedUnarchiver
source§impl Borrow<AnyObject> for NSKeyedUnarchiver
impl Borrow<AnyObject> for NSKeyedUnarchiver
source§impl Borrow<NSCoder> for NSKeyedUnarchiver
impl Borrow<NSCoder> for NSKeyedUnarchiver
source§impl Borrow<NSObject> for NSKeyedUnarchiver
impl Borrow<NSObject> for NSKeyedUnarchiver
source§impl BorrowMut<AnyObject> for NSKeyedUnarchiver
impl BorrowMut<AnyObject> for NSKeyedUnarchiver
source§fn borrow_mut(&mut self) -> &mut AnyObject
fn borrow_mut(&mut self) -> &mut AnyObject
Mutably borrows from an owned value. Read more
source§impl BorrowMut<NSCoder> for NSKeyedUnarchiver
impl BorrowMut<NSCoder> for NSKeyedUnarchiver
source§fn borrow_mut(&mut self) -> &mut NSCoder
fn borrow_mut(&mut self) -> &mut NSCoder
Mutably borrows from an owned value. Read more
source§impl BorrowMut<NSObject> for NSKeyedUnarchiver
impl BorrowMut<NSObject> for NSKeyedUnarchiver
source§fn borrow_mut(&mut self) -> &mut NSObject
fn borrow_mut(&mut self) -> &mut NSObject
Mutably borrows from an owned value. Read more
source§impl ClassType for NSKeyedUnarchiver
impl ClassType for NSKeyedUnarchiver
§type Mutability = InteriorMutable
type Mutability = InteriorMutable
Whether the type is mutable or immutable. Read more
source§const NAME: &'static str = "NSKeyedUnarchiver"
const NAME: &'static str = "NSKeyedUnarchiver"
The name of the Objective-C class that this type represents. Read more
source§fn class() -> &'static AnyClass
fn class() -> &'static AnyClass
Get a reference to the Objective-C class that this type represents. Read more
source§fn as_super_mut(&mut self) -> &mut Self::Super
fn as_super_mut(&mut self) -> &mut Self::Super
Get a mutable reference to the superclass.
source§impl Debug for NSKeyedUnarchiver
impl Debug for NSKeyedUnarchiver
source§impl Deref for NSKeyedUnarchiver
impl Deref for NSKeyedUnarchiver
source§impl DerefMut for NSKeyedUnarchiver
impl DerefMut for NSKeyedUnarchiver
source§impl Hash for NSKeyedUnarchiver
impl Hash for NSKeyedUnarchiver
source§impl NSObjectProtocol for NSKeyedUnarchiver
impl NSObjectProtocol for NSKeyedUnarchiver
source§fn isEqual(&self, other: &AnyObject) -> bool
fn isEqual(&self, other: &AnyObject) -> bool
Check whether the object is equal to an arbitrary other object. Read more
source§fn hash(&self) -> usize
fn hash(&self) -> usize
An integer that can be used as a table address in a hash table
structure. Read more
source§fn isKindOfClass(&self, cls: &AnyClass) -> bool
fn isKindOfClass(&self, cls: &AnyClass) -> bool
Check if the object is an instance of the class, or one of its
subclasses. Read more
source§fn is_kind_of<T>(&self) -> bool
fn is_kind_of<T>(&self) -> bool
Check if the object is an instance of the class type, or one of its
subclasses. Read more
source§fn isMemberOfClass(&self, cls: &AnyClass) -> bool
fn isMemberOfClass(&self, cls: &AnyClass) -> bool
Check if the object is an instance of a specific class, without
checking subclasses. Read more
source§fn respondsToSelector(&self, aSelector: Sel) -> bool
fn respondsToSelector(&self, aSelector: Sel) -> bool
Check whether the object implements or inherits a method with the
given selector. Read more
source§fn conformsToProtocol(&self, aProtocol: &AnyProtocol) -> bool
fn conformsToProtocol(&self, aProtocol: &AnyProtocol) -> bool
Check whether the object conforms to a given protocol. Read more
source§fn debugDescription(&self) -> Retained<NSObject>
fn debugDescription(&self) -> Retained<NSObject>
A textual representation of the object to use when debugging. Read more
source§impl PartialEq for NSKeyedUnarchiver
impl PartialEq for NSKeyedUnarchiver
source§fn eq(&self, other: &NSKeyedUnarchiver) -> bool
fn eq(&self, other: &NSKeyedUnarchiver) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl RefEncode for NSKeyedUnarchiver
impl RefEncode for NSKeyedUnarchiver
source§const ENCODING_REF: Encoding = <NSCoder as ::objc2::RefEncode>::ENCODING_REF
const ENCODING_REF: Encoding = <NSCoder as ::objc2::RefEncode>::ENCODING_REF
The Objective-C type-encoding for a reference of this type. Read more
impl Eq for NSKeyedUnarchiver
impl Message for NSKeyedUnarchiver
impl StructuralPartialEq for NSKeyedUnarchiver
Auto Trait Implementations§
impl !Freeze for NSKeyedUnarchiver
impl !RefUnwindSafe for NSKeyedUnarchiver
impl !Send for NSKeyedUnarchiver
impl !Sync for NSKeyedUnarchiver
impl !Unpin for NSKeyedUnarchiver
impl !UnwindSafe for NSKeyedUnarchiver
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CounterpartOrSelf for T
impl<T> CounterpartOrSelf for T
§type Immutable = <<T as ClassType>::Mutability as MutabilityCounterpartOrSelf<T>>::Immutable
type Immutable = <<T as ClassType>::Mutability as MutabilityCounterpartOrSelf<T>>::Immutable
The immutable counterpart of the type, or
Self
if the type has no
immutable counterpart. Read more§type Mutable = <<T as ClassType>::Mutability as MutabilityCounterpartOrSelf<T>>::Mutable
type Mutable = <<T as ClassType>::Mutability as MutabilityCounterpartOrSelf<T>>::Mutable
The mutable counterpart of the type, or
Self
if the type has no
mutable counterpart. Read more