Struct objc2_foundation::NSArchiver
source · #[repr(C)]pub struct NSArchiver { /* private fields */ }
👎Deprecated: Use NSKeyedArchiver instead
Available on crate features
NSArchiver
and NSCoder
only.Implementations§
source§impl NSArchiver
impl NSArchiver
pub unsafe fn initForWritingWithMutableData( this: Allocated<Self>, mdata: &NSMutableData ) -> Retained<Self>
👎Deprecated: Use NSKeyedArchiver instead
Available on crate feature
NSData
only.pub unsafe fn archiverData(&self) -> Retained<NSMutableData>
👎Deprecated: Use NSKeyedArchiver instead
Available on crate feature
NSData
only.pub unsafe fn encodeRootObject(&self, root_object: &AnyObject)
👎Deprecated: Use NSKeyedArchiver instead
pub unsafe fn encodeConditionalObject(&self, object: Option<&AnyObject>)
👎Deprecated: Use NSKeyedArchiver instead
pub unsafe fn archivedDataWithRootObject( root_object: &AnyObject ) -> Retained<NSData>
👎Deprecated: Use NSKeyedArchiver instead
Available on crate feature
NSData
only.pub unsafe fn archiveRootObject_toFile( root_object: &AnyObject, path: &NSString ) -> bool
👎Deprecated: Use NSKeyedArchiver instead
Available on crate feature
NSString
only.pub unsafe fn encodeClassName_intoClassName( &self, true_name: &NSString, in_archive_name: &NSString )
👎Deprecated: Use NSKeyedArchiver instead
Available on crate feature
NSString
only.pub unsafe fn classNameEncodedForTrueClassName( &self, true_name: &NSString ) -> Option<Retained<NSString>>
👎Deprecated: Use NSKeyedArchiver instead
Available on crate feature
NSString
only.pub unsafe fn replaceObject_withObject( &self, object: &AnyObject, new_object: &AnyObject )
👎Deprecated: Use NSKeyedArchiver instead
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 NSArchiver
impl AsMut<AnyObject> for NSArchiver
source§impl AsMut<NSArchiver> for NSArchiver
impl AsMut<NSArchiver> for NSArchiver
source§impl AsMut<NSCoder> for NSArchiver
impl AsMut<NSCoder> for NSArchiver
source§impl AsMut<NSObject> for NSArchiver
impl AsMut<NSObject> for NSArchiver
source§impl AsRef<AnyObject> for NSArchiver
impl AsRef<AnyObject> for NSArchiver
source§impl AsRef<NSArchiver> for NSArchiver
impl AsRef<NSArchiver> for NSArchiver
source§impl AsRef<NSCoder> for NSArchiver
impl AsRef<NSCoder> for NSArchiver
source§impl AsRef<NSObject> for NSArchiver
impl AsRef<NSObject> for NSArchiver
source§impl Borrow<AnyObject> for NSArchiver
impl Borrow<AnyObject> for NSArchiver
source§impl Borrow<NSCoder> for NSArchiver
impl Borrow<NSCoder> for NSArchiver
source§impl Borrow<NSObject> for NSArchiver
impl Borrow<NSObject> for NSArchiver
source§impl BorrowMut<AnyObject> for NSArchiver
impl BorrowMut<AnyObject> for NSArchiver
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 NSArchiver
impl BorrowMut<NSCoder> for NSArchiver
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 NSArchiver
impl BorrowMut<NSObject> for NSArchiver
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 NSArchiver
impl ClassType for NSArchiver
§type Mutability = InteriorMutable
type Mutability = InteriorMutable
Whether the type is mutable or immutable. Read more
source§const NAME: &'static str = "NSArchiver"
const NAME: &'static str = "NSArchiver"
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 NSArchiver
impl Debug for NSArchiver
source§impl Deref for NSArchiver
impl Deref for NSArchiver
source§impl DerefMut for NSArchiver
impl DerefMut for NSArchiver
source§impl Hash for NSArchiver
impl Hash for NSArchiver
source§impl NSObjectProtocol for NSArchiver
impl NSObjectProtocol for NSArchiver
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 NSArchiver
impl PartialEq for NSArchiver
source§fn eq(&self, other: &NSArchiver) -> bool
fn eq(&self, other: &NSArchiver) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl RefEncode for NSArchiver
impl RefEncode for NSArchiver
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 NSArchiver
impl Message for NSArchiver
impl StructuralPartialEq for NSArchiver
Auto Trait Implementations§
impl !Freeze for NSArchiver
impl !RefUnwindSafe for NSArchiver
impl !Send for NSArchiver
impl !Sync for NSArchiver
impl !Unpin for NSArchiver
impl !UnwindSafe for NSArchiver
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