Struct icrate::Foundation::NSCoder
source · #[repr(C)]pub struct NSCoder { /* private fields */ }Foundation and Foundation_NSCoder only.Implementations§
source§impl NSCoder
impl NSCoder
NSAppKitColorExtensions
pub unsafe fn decodeNXColor(&self) -> Option<Id<NSColor>>
AppKit and AppKit_NSColor only.source§impl NSCoder
impl NSCoder
pub unsafe fn encodeValueOfObjCType_at( &self, type: NonNull<c_char>, addr: NonNull<c_void> )
pub unsafe fn encodeDataObject(&self, data: &NSData)
Foundation_NSData only.pub unsafe fn decodeDataObject(&self) -> Option<Id<NSData>>
Foundation_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
Foundation_NSString only.source§impl NSCoder
impl NSCoder
NSExtendedCoder
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<Id<AnyObject>>
pub unsafe fn decodeTopLevelObjectAndReturnError( &self ) -> Result<Id<AnyObject>, Id<NSError>>
Foundation_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<Id<AnyObject>>
pub unsafe fn setObjectZone(&self, zone: *mut NSZone)
pub unsafe fn objectZone(&self) -> *mut NSZone
pub unsafe fn systemVersion(&self) -> c_uint
pub unsafe fn allowsKeyedCoding(&self) -> bool
pub unsafe fn encodeObject_forKey( &self, object: Option<&AnyObject>, key: &NSString )
Foundation_NSString only.pub unsafe fn encodeConditionalObject_forKey( &self, object: Option<&AnyObject>, key: &NSString )
Foundation_NSString only.pub unsafe fn encodeBool_forKey(&self, value: bool, key: &NSString)
Foundation_NSString only.pub unsafe fn encodeInt_forKey(&self, value: c_int, key: &NSString)
Foundation_NSString only.pub unsafe fn encodeInt32_forKey(&self, value: i32, key: &NSString)
Foundation_NSString only.pub unsafe fn encodeInt64_forKey(&self, value: i64, key: &NSString)
Foundation_NSString only.pub unsafe fn encodeFloat_forKey(&self, value: c_float, key: &NSString)
Foundation_NSString only.pub unsafe fn encodeDouble_forKey(&self, value: c_double, key: &NSString)
Foundation_NSString only.pub unsafe fn encodeBytes_length_forKey( &self, bytes: *mut u8, length: NSUInteger, key: &NSString )
Foundation_NSString only.pub unsafe fn containsValueForKey(&self, key: &NSString) -> bool
Foundation_NSString only.pub unsafe fn decodeObjectForKey(&self, key: &NSString) -> Option<Id<AnyObject>>
Foundation_NSString only.pub unsafe fn decodeTopLevelObjectForKey_error( &self, key: &NSString ) -> Result<Id<AnyObject>, Id<NSError>>
Foundation_NSError and Foundation_NSString only.pub unsafe fn decodeBoolForKey(&self, key: &NSString) -> bool
Foundation_NSString only.pub unsafe fn decodeIntForKey(&self, key: &NSString) -> c_int
Foundation_NSString only.pub unsafe fn decodeInt32ForKey(&self, key: &NSString) -> i32
Foundation_NSString only.pub unsafe fn decodeInt64ForKey(&self, key: &NSString) -> i64
Foundation_NSString only.pub unsafe fn decodeFloatForKey(&self, key: &NSString) -> c_float
Foundation_NSString only.pub unsafe fn decodeDoubleForKey(&self, key: &NSString) -> c_double
Foundation_NSString only.pub unsafe fn decodeBytesForKey_returnedLength( &self, key: &NSString, lengthp: *mut NSUInteger ) -> *mut u8
Foundation_NSString only.pub unsafe fn encodeInteger_forKey(&self, value: NSInteger, key: &NSString)
Foundation_NSString only.pub unsafe fn decodeIntegerForKey(&self, key: &NSString) -> NSInteger
Foundation_NSString only.pub unsafe fn requiresSecureCoding(&self) -> bool
pub unsafe fn decodeObjectOfClass_forKey( &self, a_class: &AnyClass, key: &NSString ) -> Option<Id<AnyObject>>
Foundation_NSString only.pub unsafe fn decodeTopLevelObjectOfClass_forKey_error( &self, a_class: &AnyClass, key: &NSString ) -> Result<Id<AnyObject>, Id<NSError>>
Foundation_NSError and Foundation_NSString only.pub unsafe fn decodeArrayOfObjectsOfClass_forKey( &self, cls: &AnyClass, key: &NSString ) -> Option<Id<NSArray>>
Foundation_NSArray and Foundation_NSString only.pub unsafe fn decodeDictionaryWithKeysOfClass_objectsOfClass_forKey( &self, key_cls: &AnyClass, object_cls: &AnyClass, key: &NSString ) -> Option<Id<NSDictionary>>
Foundation_NSDictionary and Foundation_NSString only.pub unsafe fn decodeObjectOfClasses_forKey( &self, classes: Option<&NSSet<AnyObject>>, key: &NSString ) -> Option<Id<AnyObject>>
Foundation_NSSet and Foundation_NSString only.pub unsafe fn decodeTopLevelObjectOfClasses_forKey_error( &self, classes: Option<&NSSet<AnyObject>>, key: &NSString ) -> Result<Id<AnyObject>, Id<NSError>>
Foundation_NSError and Foundation_NSSet and Foundation_NSString only.pub unsafe fn decodeArrayOfObjectsOfClasses_forKey( &self, classes: &NSSet<AnyObject>, key: &NSString ) -> Option<Id<NSArray>>
Foundation_NSArray and Foundation_NSSet and Foundation_NSString only.pub unsafe fn decodeDictionaryWithKeysOfClasses_objectsOfClasses_forKey( &self, key_classes: &NSSet<AnyObject>, object_classes: &NSSet<AnyObject>, key: &NSString ) -> Option<Id<NSDictionary>>
Foundation_NSDictionary and Foundation_NSSet and Foundation_NSString only.pub unsafe fn decodePropertyListForKey( &self, key: &NSString ) -> Option<Id<AnyObject>>
Foundation_NSString only.pub unsafe fn allowedClasses(&self) -> Option<Id<NSSet<AnyObject>>>
Foundation_NSSet only.pub unsafe fn failWithError(&self, error: &NSError)
Foundation_NSError only.pub unsafe fn decodingFailurePolicy(&self) -> NSDecodingFailurePolicy
pub unsafe fn error(&self) -> Option<Id<NSError>>
Foundation_NSError only.source§impl NSCoder
impl NSCoder
NSTypedstreamCompatibility
pub unsafe fn encodeNXObject(&self, object: &AnyObject)
pub unsafe fn decodeNXObject(&self) -> Option<Id<AnyObject>>
source§impl NSCoder
impl NSCoder
NSGeometryCoding
pub unsafe fn encodePoint(&self, point: NSPoint)
pub unsafe fn decodePoint(&self) -> NSPoint
pub unsafe fn encodeSize(&self, size: NSSize)
pub unsafe fn decodeSize(&self) -> NSSize
pub unsafe fn encodeRect(&self, rect: NSRect)
pub unsafe fn decodeRect(&self) -> NSRect
source§impl NSCoder
impl NSCoder
NSGeometryKeyedCoding
pub unsafe fn encodePoint_forKey(&self, point: NSPoint, key: &NSString)
Foundation_NSString only.pub unsafe fn encodeSize_forKey(&self, size: NSSize, key: &NSString)
Foundation_NSString only.pub unsafe fn encodeRect_forKey(&self, rect: NSRect, key: &NSString)
Foundation_NSString only.pub unsafe fn decodePointForKey(&self, key: &NSString) -> NSPoint
Foundation_NSString only.pub unsafe fn decodeSizeForKey(&self, key: &NSString) -> NSSize
Foundation_NSString only.pub unsafe fn decodeRectForKey(&self, key: &NSString) -> NSRect
Foundation_NSString only.Methods from Deref<Target = AnyObject>§
sourcepub unsafe fn ivar_ptr<T>(&self, name: &str) -> *mut Twhere
T: Encode,
pub unsafe fn ivar_ptr<T>(&self, name: &str) -> *mut Twhere T: Encode,
Returns a pointer to the instance variable / ivar with the given name.
This is similar to UnsafeCell::get, see that for more information
on what is and isn’t safe to do.
Usually you will have defined the instance variable yourself with
ClassBuilder::add_ivar, the type of the ivar T must match the
type used in that.
Attempting to access or modify private implementation details of a class that you do no control using this is not supported, and may invoke undefined behaviour.
Library implementors are strongly encouraged to expose a safe interface to the ivar.
Panics
May panic if the object has no ivar with the given name. May also
panic if the type encoding of the ivar differs from the type encoding
of T.
This should purely seen as help while debugging and is not guaranteed
(e.g. it may be disabled when debug_assertions are off).
Safety
The object must have an instance variable with the given name, and it
must be of type T. Any invariants that the object have assumed about
the value of the instance variable must not be violated.
No thread syncronization is done on accesses to the variable, so you must ensure that any access to the returned pointer do not cause data races, and that Rust’s mutability rules are not otherwise violated.
sourcepub unsafe fn ivar<T>(&self, name: &str) -> &Twhere
T: Encode,
pub unsafe fn ivar<T>(&self, name: &str) -> &Twhere T: Encode,
Returns a reference to the instance variable with the given name.
See AnyObject::ivar_ptr for more information, including on when
this panics.
Safety
The object must have an instance variable with the given name, and it
must be of type T.
No thread syncronization is done, so you must ensure that no other
thread is concurrently mutating the variable. This requirement can be
considered upheld if all mutation happens through
AnyObject::ivar_mut (since that takes &mut self).
sourcepub unsafe fn get_ivar<T>(&self, name: &str) -> &Twhere
T: Encode,
👎Deprecated: Use AnyObject::ivar instead.
pub unsafe fn get_ivar<T>(&self, name: &str) -> &Twhere T: Encode,
AnyObject::ivar instead.sourcepub unsafe fn ivar_mut<T>(&mut self, name: &str) -> &mut Twhere
T: Encode,
pub unsafe fn ivar_mut<T>(&mut self, name: &str) -> &mut Twhere T: Encode,
Returns a mutable reference to the ivar with the given name.
See AnyObject::ivar_ptr for more information, including on when
this panics.
Safety
The object must have an instance variable with the given name, and it
must be of type T.
This access happens through &mut self, which means we know it to be
the only reference, hence you do not need to do any work to ensure
that data races do not happen.
sourcepub unsafe fn get_mut_ivar<T>(&mut self, name: &str) -> &mut Twhere
T: Encode,
👎Deprecated: Use AnyObject::ivar_mut instead.
pub unsafe fn get_mut_ivar<T>(&mut self, name: &str) -> &mut Twhere T: Encode,
AnyObject::ivar_mut instead.sourcepub unsafe fn set_ivar<T>(&mut self, name: &str, value: T)where
T: Encode,
pub unsafe fn set_ivar<T>(&mut self, name: &str, value: T)where T: Encode,
Sets the value of the ivar with the given name.
This is a shorthand for AnyObject::ivar_mut, see that for more
information.
Safety
Same as AnyObject::ivar_mut.