Struct objc2_foundation::NSPurgeableData
source · #[repr(C)]pub struct NSPurgeableData { /* private fields */ }
Available on crate feature
NSData
only.Implementations§
Methods from Deref<Target = NSMutableData>§
pub fn bytes_mut(&mut self) -> &mut [u8] ⓘ
pub fn extend_from_slice(&mut self, bytes: &[u8])
pub fn push(&mut self, byte: u8)
pub fn replace_range(&mut self, range: Range<usize>, bytes: &[u8])
Available on crate feature
NSRange
only.pub fn set_bytes(&mut self, bytes: &[u8])
Available on crate feature
NSRange
only.pub fn setLength(&mut self, length: NSUInteger)
pub unsafe fn appendBytes_length( &mut self, bytes: NonNull<c_void>, length: NSUInteger )
pub unsafe fn appendData(&mut self, other: &NSData)
pub unsafe fn increaseLengthBy(&mut self, extra_length: NSUInteger)
pub unsafe fn replaceBytesInRange_withBytes( &mut self, range: NSRange, bytes: NonNull<c_void> )
Available on crate feature
NSRange
only.pub unsafe fn resetBytesInRange(&mut self, range: NSRange)
Available on crate feature
NSRange
only.pub unsafe fn setData(&mut self, data: &NSData)
pub unsafe fn replaceBytesInRange_withBytes_length( &mut self, range: NSRange, replacement_bytes: *mut c_void, replacement_length: NSUInteger )
Available on crate feature
NSRange
only.pub unsafe fn decompressUsingAlgorithm_error( &mut self, algorithm: NSDataCompressionAlgorithm ) -> Result<(), Retained<NSError>>
Available on crate feature
NSError
only.pub unsafe fn compressUsingAlgorithm_error( &mut self, algorithm: NSDataCompressionAlgorithm ) -> Result<(), Retained<NSError>>
Available on crate feature
NSError
only.Methods from Deref<Target = NSData>§
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn bytes(&self) -> &[u8] ⓘ
pub fn length(&self) -> NSUInteger
pub unsafe fn description(&self) -> Retained<NSString>
Available on crate feature
NSString
only.pub unsafe fn getBytes_length( &self, buffer: NonNull<c_void>, length: NSUInteger )
pub unsafe fn getBytes_range(&self, buffer: NonNull<c_void>, range: NSRange)
Available on crate feature
NSRange
only.pub unsafe fn isEqualToData(&self, other: &NSData) -> bool
pub unsafe fn subdataWithRange(&self, range: NSRange) -> Retained<NSData>
Available on crate feature
NSRange
only.pub unsafe fn writeToFile_atomically( &self, path: &NSString, use_auxiliary_file: bool ) -> bool
Available on crate feature
NSString
only.pub unsafe fn writeToURL_atomically( &self, url: &NSURL, atomically: bool ) -> bool
Available on crate feature
NSURL
only.pub unsafe fn writeToFile_options_error( &self, path: &NSString, write_options_mask: NSDataWritingOptions ) -> Result<(), Retained<NSError>>
Available on crate features
NSError
and NSString
only.pub unsafe fn writeToURL_options_error( &self, url: &NSURL, write_options_mask: NSDataWritingOptions ) -> Result<(), Retained<NSError>>
Available on crate features
NSError
and NSURL
only.pub unsafe fn rangeOfData_options_range( &self, data_to_find: &NSData, mask: NSDataSearchOptions, search_range: NSRange ) -> NSRange
Available on crate feature
NSRange
only.pub unsafe fn enumerateByteRangesUsingBlock( &self, block: &Block<dyn Fn(NonNull<c_void>, NSRange, NonNull<Bool>) + '_> )
Available on crate features
NSRange
and block2
only.pub unsafe fn base64EncodedStringWithOptions( &self, options: NSDataBase64EncodingOptions ) -> Retained<NSString>
Available on crate feature
NSString
only.pub unsafe fn base64EncodedDataWithOptions( &self, options: NSDataBase64EncodingOptions ) -> Retained<NSData>
pub unsafe fn decompressedDataUsingAlgorithm_error( &self, algorithm: NSDataCompressionAlgorithm ) -> Result<Retained<Self>, Retained<NSError>>
Available on crate feature
NSError
only.pub unsafe fn compressedDataUsingAlgorithm_error( &self, algorithm: NSDataCompressionAlgorithm ) -> Result<Retained<Self>, Retained<NSError>>
Available on crate feature
NSError
only.pub unsafe fn getBytes(&self, buffer: NonNull<c_void>)
👎Deprecated: This method is unsafe because it could potentially cause buffer overruns. Use -getBytes:length: instead.
pub unsafe fn base64Encoding(&self) -> Retained<NSString>
👎Deprecated: Use base64EncodedStringWithOptions: instead
Available on crate feature
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 NSPurgeableData
impl AsMut<AnyObject> for NSPurgeableData
source§impl AsMut<NSData> for NSPurgeableData
impl AsMut<NSData> for NSPurgeableData
source§impl AsMut<NSMutableData> for NSPurgeableData
impl AsMut<NSMutableData> for NSPurgeableData
source§fn as_mut(&mut self) -> &mut NSMutableData ⓘ
fn as_mut(&mut self) -> &mut NSMutableData ⓘ
Converts this type into a mutable reference of the (usually inferred) input type.
source§impl AsMut<NSObject> for NSPurgeableData
impl AsMut<NSObject> for NSPurgeableData
source§impl AsMut<NSPurgeableData> for NSPurgeableData
impl AsMut<NSPurgeableData> for NSPurgeableData
source§impl AsRef<AnyObject> for NSPurgeableData
impl AsRef<AnyObject> for NSPurgeableData
source§impl AsRef<NSData> for NSPurgeableData
impl AsRef<NSData> for NSPurgeableData
source§impl AsRef<NSMutableData> for NSPurgeableData
impl AsRef<NSMutableData> for NSPurgeableData
source§fn as_ref(&self) -> &NSMutableData ⓘ
fn as_ref(&self) -> &NSMutableData ⓘ
Converts this type into a shared reference of the (usually inferred) input type.
source§impl AsRef<NSObject> for NSPurgeableData
impl AsRef<NSObject> for NSPurgeableData
source§impl AsRef<NSPurgeableData> for NSPurgeableData
impl AsRef<NSPurgeableData> for NSPurgeableData
source§impl Borrow<AnyObject> for NSPurgeableData
impl Borrow<AnyObject> for NSPurgeableData
source§impl Borrow<NSData> for NSPurgeableData
impl Borrow<NSData> for NSPurgeableData
source§impl Borrow<NSMutableData> for NSPurgeableData
impl Borrow<NSMutableData> for NSPurgeableData
source§impl Borrow<NSObject> for NSPurgeableData
impl Borrow<NSObject> for NSPurgeableData
source§impl BorrowMut<AnyObject> for NSPurgeableData
impl BorrowMut<AnyObject> for NSPurgeableData
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<NSData> for NSPurgeableData
impl BorrowMut<NSData> for NSPurgeableData
source§fn borrow_mut(&mut self) -> &mut NSData
fn borrow_mut(&mut self) -> &mut NSData
Mutably borrows from an owned value. Read more
source§impl BorrowMut<NSMutableData> for NSPurgeableData
impl BorrowMut<NSMutableData> for NSPurgeableData
source§fn borrow_mut(&mut self) -> &mut NSMutableData ⓘ
fn borrow_mut(&mut self) -> &mut NSMutableData ⓘ
Mutably borrows from an owned value. Read more
source§impl BorrowMut<NSObject> for NSPurgeableData
impl BorrowMut<NSObject> for NSPurgeableData
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 NSPurgeableData
impl ClassType for NSPurgeableData
§type Super = NSMutableData
type Super = NSMutableData
The superclass of this class. Read more
§type Mutability = Mutable
type Mutability = Mutable
Whether the type is mutable or immutable. Read more
source§const NAME: &'static str = "NSPurgeableData"
const NAME: &'static str = "NSPurgeableData"
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 NSPurgeableData
impl Debug for NSPurgeableData
source§impl Deref for NSPurgeableData
impl Deref for NSPurgeableData
source§impl DerefMut for NSPurgeableData
impl DerefMut for NSPurgeableData
source§impl Hash for NSPurgeableData
impl Hash for NSPurgeableData
source§impl NSCoding for NSPurgeableData
Available on crate feature NSObject
only.
impl NSCoding for NSPurgeableData
Available on crate feature
NSObject
only.source§impl NSDiscardableContent for NSPurgeableData
Available on crate feature NSObject
only.
impl NSDiscardableContent for NSPurgeableData
Available on crate feature
NSObject
only.unsafe fn beginContentAccess(&self) -> bool
unsafe fn endContentAccess(&self)
unsafe fn discardContentIfPossible(&self)
unsafe fn isContentDiscarded(&self) -> bool
source§impl NSObjectProtocol for NSPurgeableData
impl NSObjectProtocol for NSPurgeableData
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 NSSecureCoding for NSPurgeableData
Available on crate feature NSObject
only.
impl NSSecureCoding for NSPurgeableData
Available on crate feature
NSObject
only.source§impl PartialEq for NSPurgeableData
impl PartialEq for NSPurgeableData
source§fn eq(&self, other: &NSPurgeableData) -> bool
fn eq(&self, other: &NSPurgeableData) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl RefEncode for NSPurgeableData
impl RefEncode for NSPurgeableData
source§const ENCODING_REF: Encoding = <NSMutableData as ::objc2::RefEncode>::ENCODING_REF
const ENCODING_REF: Encoding = <NSMutableData as ::objc2::RefEncode>::ENCODING_REF
The Objective-C type-encoding for a reference of this type. Read more
impl Eq for NSPurgeableData
impl Message for NSPurgeableData
impl StructuralPartialEq for NSPurgeableData
Auto Trait Implementations§
impl !Freeze for NSPurgeableData
impl RefUnwindSafe for NSPurgeableData
impl Send for NSPurgeableData
impl Sync for NSPurgeableData
impl !Unpin for NSPurgeableData
impl UnwindSafe for NSPurgeableData
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