Struct objc2_foundation::NSKeyedArchiver
source · #[repr(C)]pub struct NSKeyedArchiver { /* private fields */ }
Available on crate features
NSCoder
and NSKeyedArchiver
only.Implementations§
source§impl NSKeyedArchiver
impl NSKeyedArchiver
pub unsafe fn initRequiringSecureCoding( this: Allocated<Self>, requires_secure_coding: bool ) -> Retained<Self>
pub unsafe fn archivedDataWithRootObject_requiringSecureCoding_error( object: &AnyObject, requires_secure_coding: bool ) -> Result<Retained<NSData>, Retained<NSError>>
Available on crate features
NSData
and NSError
only.pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>
👎Deprecated: Use -initRequiringSecureCoding: instead
pub unsafe fn initForWritingWithMutableData( this: Allocated<Self>, data: &NSMutableData ) -> Retained<Self>
👎Deprecated: Use -initRequiringSecureCoding: instead
Available on crate feature
NSData
only.pub unsafe fn archivedDataWithRootObject( root_object: &AnyObject ) -> Retained<NSData>
👎Deprecated: Use +archivedDataWithRootObject:requiringSecureCoding:error: instead
Available on crate feature
NSData
only.pub unsafe fn archiveRootObject_toFile( root_object: &AnyObject, path: &NSString ) -> bool
👎Deprecated: Use +archivedDataWithRootObject:requiringSecureCoding:error: and -writeToURL:options:error: instead
Available on crate feature
NSString
only.pub unsafe fn delegate( &self ) -> Option<Retained<ProtocolObject<dyn NSKeyedArchiverDelegate>>>
pub unsafe fn setDelegate( &self, delegate: Option<&ProtocolObject<dyn NSKeyedArchiverDelegate>> )
pub unsafe fn outputFormat(&self) -> NSPropertyListFormat
Available on crate feature
NSPropertyList
only.pub unsafe fn setOutputFormat(&self, output_format: NSPropertyListFormat)
Available on crate feature
NSPropertyList
only.pub unsafe fn encodedData(&self) -> Retained<NSData>
Available on crate feature
NSData
only.pub unsafe fn finishEncoding(&self)
pub unsafe fn setClassName_forClass_class( coded_name: Option<&NSString>, cls: &AnyClass )
Available on crate feature
NSString
only.pub unsafe fn setClassName_forClass( &self, coded_name: Option<&NSString>, cls: &AnyClass )
Available on crate feature
NSString
only.pub unsafe fn classNameForClass_class( cls: &AnyClass ) -> Option<Retained<NSString>>
Available on crate feature
NSString
only.pub unsafe fn classNameForClass( &self, cls: &AnyClass ) -> Option<Retained<NSString>>
Available on crate feature
NSString
only.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 requiresSecureCoding(&self) -> bool
pub unsafe fn setRequiresSecureCoding(&self, requires_secure_coding: bool)
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 NSKeyedArchiver
impl AsMut<AnyObject> for NSKeyedArchiver
source§impl AsMut<NSCoder> for NSKeyedArchiver
impl AsMut<NSCoder> for NSKeyedArchiver
source§impl AsMut<NSKeyedArchiver> for NSKeyedArchiver
impl AsMut<NSKeyedArchiver> for NSKeyedArchiver
source§impl AsMut<NSObject> for NSKeyedArchiver
impl AsMut<NSObject> for NSKeyedArchiver
source§impl AsRef<AnyObject> for NSKeyedArchiver
impl AsRef<AnyObject> for NSKeyedArchiver
source§impl AsRef<NSCoder> for NSKeyedArchiver
impl AsRef<NSCoder> for NSKeyedArchiver
source§impl AsRef<NSKeyedArchiver> for NSKeyedArchiver
impl AsRef<NSKeyedArchiver> for NSKeyedArchiver
source§impl AsRef<NSObject> for NSKeyedArchiver
impl AsRef<NSObject> for NSKeyedArchiver
source§impl Borrow<AnyObject> for NSKeyedArchiver
impl Borrow<AnyObject> for NSKeyedArchiver
source§impl Borrow<NSCoder> for NSKeyedArchiver
impl Borrow<NSCoder> for NSKeyedArchiver
source§impl Borrow<NSObject> for NSKeyedArchiver
impl Borrow<NSObject> for NSKeyedArchiver
source§impl BorrowMut<AnyObject> for NSKeyedArchiver
impl BorrowMut<AnyObject> for NSKeyedArchiver
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 NSKeyedArchiver
impl BorrowMut<NSCoder> for NSKeyedArchiver
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 NSKeyedArchiver
impl BorrowMut<NSObject> for NSKeyedArchiver
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 NSKeyedArchiver
impl ClassType for NSKeyedArchiver
§type Mutability = InteriorMutable
type Mutability = InteriorMutable
Whether the type is mutable or immutable. Read more
source§const NAME: &'static str = "NSKeyedArchiver"
const NAME: &'static str = "NSKeyedArchiver"
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 NSKeyedArchiver
impl Debug for NSKeyedArchiver
source§impl Deref for NSKeyedArchiver
impl Deref for NSKeyedArchiver
source§impl DerefMut for NSKeyedArchiver
impl DerefMut for NSKeyedArchiver
source§impl Hash for NSKeyedArchiver
impl Hash for NSKeyedArchiver
source§impl NSObjectProtocol for NSKeyedArchiver
impl NSObjectProtocol for NSKeyedArchiver
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 NSKeyedArchiver
impl PartialEq for NSKeyedArchiver
source§fn eq(&self, other: &NSKeyedArchiver) -> bool
fn eq(&self, other: &NSKeyedArchiver) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl RefEncode for NSKeyedArchiver
impl RefEncode for NSKeyedArchiver
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 NSKeyedArchiver
impl Message for NSKeyedArchiver
impl StructuralPartialEq for NSKeyedArchiver
Auto Trait Implementations§
impl !Freeze for NSKeyedArchiver
impl !RefUnwindSafe for NSKeyedArchiver
impl !Send for NSKeyedArchiver
impl !Sync for NSKeyedArchiver
impl !Unpin for NSKeyedArchiver
impl !UnwindSafe for NSKeyedArchiver
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