#[repr(C)]pub struct NSCoder {
pub ptr: Id<Object>,
}
Expand description
An abstract class that serves as the basis for objects that enable archiving and distribution of other objects.
Fields§
§ptr: Id<Object>
The raw pointer to the Objective-C object.
Implementations§
Source§impl NSCoder
impl NSCoder
Sourcepub fn allows_keyed_coding(&self) -> bool
pub fn allows_keyed_coding(&self) -> bool
Returns a Boolean value that indicates whether an encoded value is available for a string.
Sourcepub fn contains_value_for_key(&self, key: NSString) -> bool
pub fn contains_value_for_key(&self, key: NSString) -> bool
Returns a Boolean value that indicates whether an encoded value is available for a string.
Sourcepub fn decoding_failure_policy(&self) -> NSDecodingFailurePolicy
pub fn decoding_failure_policy(&self) -> NSDecodingFailurePolicy
The action the coder should take when decoding fails.
Sourcepub fn encode_array_of_objc_type_count_at(
&mut self,
type_: *const c_char,
count: usize,
array: *const c_void,
)
pub fn encode_array_of_objc_type_count_at( &mut self, type_: *const c_char, count: usize, array: *const c_void, )
Encodes an array of the given Objective-C type, provided the number of items and a pointer.
Sourcepub fn encode_bool_for_key(&mut self, value: bool, key: NSString)
pub fn encode_bool_for_key(&mut self, value: bool, key: NSString)
Encodes a Boolean value and associates it with the string key.
Sourcepub fn encode_bycopy_object<T>(&mut self, object: T)
pub fn encode_bycopy_object<T>(&mut self, object: T)
An encoding method for subclasses to override such that it creates a copy, rather than a proxy, when decoded.
Sourcepub fn encode_byref_object<T>(&mut self, object: T)where
T: PNSObject,
pub fn encode_byref_object<T>(&mut self, object: T)where
T: PNSObject,
An encoding method for subclasses to override such that it creates a proxy, rather than a copy, when decoded.
Sourcepub fn encode_bytes_length(&mut self, bytes: *const c_void, length: UInt)
pub fn encode_bytes_length(&mut self, bytes: *const c_void, length: UInt)
Encodes a buffer of data of an unspecified type.
Sourcepub fn encode_bytes_length_for_key(
&mut self,
bytes: *const UInt8,
length: UInt,
key: NSString,
)
pub fn encode_bytes_length_for_key( &mut self, bytes: *const UInt8, length: UInt, key: NSString, )
Encodes a buffer of data, given its length and a pointer, and associates it with a string key.
Sourcepub fn encode_conditional_object<T>(&mut self, object: T)where
T: PNSObject,
pub fn encode_conditional_object<T>(&mut self, object: T)where
T: PNSObject,
An encoding method for subclasses to override to conditionally encode an object, preserving common references to it.
Sourcepub fn encode_conditional_object_for_key<T>(&mut self, object: T, key: NSString)where
T: PNSObject,
pub fn encode_conditional_object_for_key<T>(&mut self, object: T, key: NSString)where
T: PNSObject,
An encoding method for subclasses to override to conditionally encode an object, preserving common references to it, only if it has been unconditionally encoded.
Sourcepub fn encode_data_object<T>(&mut self, object: T)where
T: PNSObject,
pub fn encode_data_object<T>(&mut self, object: T)where
T: PNSObject,
Encodes a given data object.
Sourcepub fn encode_double_for_key(&mut self, value: c_double, key: NSString)
pub fn encode_double_for_key(&mut self, value: c_double, key: NSString)
Encodes a double-precision floating point value and associates it with the string key.
Sourcepub fn encode_float_for_key(&mut self, value: c_float, key: NSString)
pub fn encode_float_for_key(&mut self, value: c_float, key: NSString)
Encodes a floating point value and associates it with the string key.
Sourcepub fn encode_int_for_key(&mut self, value: Int, key: NSString)
pub fn encode_int_for_key(&mut self, value: Int, key: NSString)
Encodes a C integer value and associates it with the string key.
Sourcepub fn encode_integer_for_key(&mut self, value: Int, key: NSString)
pub fn encode_integer_for_key(&mut self, value: Int, key: NSString)
Encodes an integer value and associates it with the string key.
Sourcepub fn encode_int32_for_key(&mut self, value: Int32, key: NSString)
pub fn encode_int32_for_key(&mut self, value: Int32, key: NSString)
Encodes a 32-bit integer value and associates it with the string key.
Sourcepub fn encode_int64_for_key(&mut self, value: Int64, key: NSString)
pub fn encode_int64_for_key(&mut self, value: Int64, key: NSString)
Encodes a 64-bit integer value and associates it with the string key.
Sourcepub fn encode_object<T>(&mut self, object: T)where
T: PNSObject,
pub fn encode_object<T>(&mut self, object: T)where
T: PNSObject,
Encodes an object.
Sourcepub fn encode_object_for_key<T>(&mut self, object: T, key: NSString)where
T: PNSObject,
pub fn encode_object_for_key<T>(&mut self, object: T, key: NSString)where
T: PNSObject,
Encodes an object and associates it with the string key.
Sourcepub fn encode_point(&mut self, point: NSPoint)
pub fn encode_point(&mut self, point: NSPoint)
Encodes a point.
Sourcepub fn encode_point_for_key(&mut self, point: NSPoint, key: NSString)
pub fn encode_point_for_key(&mut self, point: NSPoint, key: NSString)
Encodes a point and associates it with the string key.
Sourcepub fn encode_property_list(&mut self, property_list: id)
pub fn encode_property_list(&mut self, property_list: id)
Encodes a property list.
Sourcepub fn encode_rect(&mut self, rect: NSRect)
pub fn encode_rect(&mut self, rect: NSRect)
Encodes a rectangle structure.
Sourcepub fn encode_rect_for_key(&mut self, rect: NSRect, key: NSString)
pub fn encode_rect_for_key(&mut self, rect: NSRect, key: NSString)
Encodes a rectangle structure and associates it with the string key.
Sourcepub fn encode_root_object(&mut self, root_object: id)
pub fn encode_root_object(&mut self, root_object: id)
An encoding method for subclasses to override to encode an interconnected group of objects, starting with the provided root object.
Sourcepub fn encode_size(&mut self, size: NSSize)
pub fn encode_size(&mut self, size: NSSize)
Encodes a size structure.
Sourcepub fn encode_size_for_key(&mut self, size: NSSize, key: NSString)
pub fn encode_size_for_key(&mut self, size: NSSize, key: NSString)
Encodes a size structure and associates it with the given string key.
Sourcepub fn encode_value_of_objc_type_at(
&mut self,
_type: *const c_char,
addr: *const c_void,
)
pub fn encode_value_of_objc_type_at( &mut self, _type: *const c_char, addr: *const c_void, )
Encodes a value of the given type at the given address.
Sourcepub fn encode_cgpoint_for_key(&mut self, point: CGPoint, key: NSString)
pub fn encode_cgpoint_for_key(&mut self, point: CGPoint, key: NSString)
Encodes a point and associates it with the specified key in the receiver’s archive.
Sourcepub fn encode_cgrect_for_key(&mut self, rect: CGRect, key: NSString)
pub fn encode_cgrect_for_key(&mut self, rect: CGRect, key: NSString)
Encodes a rectangle and associates it with the specified key in the receiver’s archive.
Sourcepub fn encode_cgzize_for_key(&mut self, size: CGSize, key: NSString)
pub fn encode_cgzize_for_key(&mut self, size: CGSize, key: NSString)
Encodes size information and associates it with the specified key in the coder’s archive.
Methods from Deref<Target = Object>§
Sourcepub unsafe fn get_ivar<T>(&self, name: &str) -> &Twhere
T: Encode,
pub unsafe fn get_ivar<T>(&self, name: &str) -> &Twhere
T: Encode,
Returns a reference to the ivar of self with the given name.
Panics if self has no ivar with the given name.
Unsafe because the caller must ensure that the ivar is actually
of type T
.
Sourcepub unsafe fn get_mut_ivar<T>(&mut self, name: &str) -> &mut Twhere
T: Encode,
pub unsafe fn get_mut_ivar<T>(&mut self, name: &str) -> &mut Twhere
T: Encode,
Returns a mutable reference to the ivar of self with the given name.
Panics if self has no ivar with the given name.
Unsafe because the caller must ensure that the ivar is actually
of type T
.