Trait INSData

Source
pub trait INSData: PNSObject {
Show 36 methods // Provided methods fn m_data() -> Self where Self: Sized + FromId { ... } fn m_data_with_bytes_length(bytes: *const c_void, length: UInt) -> Self where Self: Sized + FromId { ... } fn m_data_with_bytes_no_copy_length( bytes: *mut c_void, length: UInt, ) -> Self where Self: Sized + FromId { ... } fn m_data_with_bytes_no_copy_length_free_when_done( bytes: *mut c_void, length: UInt, b: bool, ) -> Self where Self: Sized + FromId { ... } fn m_data_with_data(data: NSData) -> Self where Self: Sized + FromId { ... } fn m_init_with_bytes_length( &mut self, bytes: *const c_void, length: UInt, ) -> Self where Self: Sized + FromId { ... } fn m_init_with_bytes_no_copy_length( &mut self, bytes: *mut c_void, length: UInt, ) -> Self where Self: Sized + FromId { ... } fn m_init_with_bytes_no_copy_length_deallocator<F>( &mut self, bytes: *mut c_void, length: UInt, deallocator: F, ) -> Self where Self: Sized + FromId, F: IntoConcreteBlock<(*mut c_void, UInt), Ret = ()> + 'static { ... } fn m_init_with_bytes_no_copy_length_free_when_done( &mut self, bytes: *mut c_void, length: UInt, b: bool, ) -> Self where Self: Sized + FromId { ... } fn m_init_with_data(&mut self, data: &NSData) -> Self where Self: Sized + FromId { ... } fn m_data_with_contents_of_file(path: &NSString) -> Self where Self: Sized + FromId { ... } fn m_data_with_contents_of_file_options( path: &NSString, read_options_mask: NSDataReadingOptions, ) -> Result<Self, NSError> where Self: Sized + FromId { ... } fn m_data_with_contents_of_url(url: &NSURL) -> Self where Self: Sized + FromId { ... } fn m_data_with_contents_of_url_options( url: &NSURL, read_options_mask: NSDataReadingOptions, ) -> Result<Self, NSError> where Self: Sized + FromId { ... } fn m_init_with_contents_of_file(&mut self, path: &NSString) -> Self where Self: Sized + FromId { ... } fn m_init_with_contents_of_file_options( &mut self, path: &NSString, read_options_mask: NSDataReadingOptions, ) -> Result<Self, NSError> where Self: Sized + FromId { ... } fn m_init_with_contents_of_url(&mut self, url: &NSURL) -> Self where Self: Sized + FromId { ... } fn m_init_with_contents_of_url_options( &mut self, url: &NSURL, read_options_mask: NSDataReadingOptions, ) -> Result<Self, NSError> where Self: Sized + FromId { ... } fn m_write_to_file_atomically( &self, path: &NSString, use_auxiliary_file: bool, ) -> bool { ... } fn m_write_to_file_options( &self, path: &NSString, write_options: NSDataWritingOptions, ) -> Result<bool, NSError> { ... } fn m_write_to_url_atomically(&self, url: &NSURL, atomically: bool) -> bool { ... } fn m_write_to_url_options( &self, url: &NSURL, write_options: NSDataWritingOptions, ) -> Result<bool, NSError> { ... } fn m_init_with_base64_encoded_data_options( &mut self, base64_data: &NSData, options: NSDataBase64DecodingOptions, ) -> Self where Self: Sized + FromId { ... } fn m_init_with_base64_encoded_string_options( &mut self, base64_string: &NSString, options: NSDataBase64DecodingOptions, ) -> Self where Self: Sized + FromId { ... } fn m_base64_encoded_data_with_options( &self, options: NSDataBase64EncodingOptions, ) -> NSData { ... } fn m_base64_encoded_string_with_options( &self, options: NSDataBase64EncodingOptions, ) -> NSString { ... } fn p_bytes(&self) -> *const c_void { ... } fn m_enumerate_byte_ranges_using_block<F>(&self, block: F) where F: IntoConcreteBlock<(*const c_void, NSRange, *mut bool), Ret = ()> + 'static { ... } fn m_get_bytes_length(&self, buffer: *mut c_void, length: UInt) { ... } fn m_get_bytes_range(&self, buffer: *mut c_void, range: NSRange) { ... } fn m_subdata_with_range(&self, range: NSRange) -> NSData { ... } fn m_range_of_data_options_range( &self, data_to_find: &NSData, mask: NSDataSearchOptions, search_range: NSRange, ) -> NSRange { ... } fn m_is_equal_to_data(&self, other: &NSData) -> bool { ... } fn m_length(&self) -> UInt { ... } fn m_compressed_data_using_algorithm( &self, algorithm: NSDataCompressionAlgorithm, ) -> Result<Self, NSError> where Self: Sized + FromId { ... } fn m_decompressed_data_using_algorithm( &self, algorithm: NSDataCompressionAlgorithm, ) -> Result<Self, NSError> where Self: Sized + FromId { ... }
}
Expand description

A trait containing all the methods for NSData

Provided Methods§

Source

fn m_data() -> Self
where Self: Sized + FromId,

Creates an empty data object.

Source

fn m_data_with_bytes_length(bytes: *const c_void, length: UInt) -> Self
where Self: Sized + FromId,

Creates a data object containing a given number of bytes copied from a given buffer.

Source

fn m_data_with_bytes_no_copy_length(bytes: *mut c_void, length: UInt) -> Self
where Self: Sized + FromId,

Creates a data object that holds a given number of bytes from a given buffer.

Source

fn m_data_with_bytes_no_copy_length_free_when_done( bytes: *mut c_void, length: UInt, b: bool, ) -> Self
where Self: Sized + FromId,

Creates a data object that holds a given number of bytes from a given buffer.

Source

fn m_data_with_data(data: NSData) -> Self
where Self: Sized + FromId,

Creates a data object containing the contents of another data object.

Source

fn m_init_with_bytes_length( &mut self, bytes: *const c_void, length: UInt, ) -> Self
where Self: Sized + FromId,

Initializes a data object filled with a given number of bytes copied from a given buffer.

Source

fn m_init_with_bytes_no_copy_length( &mut self, bytes: *mut c_void, length: UInt, ) -> Self
where Self: Sized + FromId,

Initializes a data object filled with a given number of bytes of data from a given buffer.

Source

fn m_init_with_bytes_no_copy_length_deallocator<F>( &mut self, bytes: *mut c_void, length: UInt, deallocator: F, ) -> Self
where Self: Sized + FromId, F: IntoConcreteBlock<(*mut c_void, UInt), Ret = ()> + 'static,

Initializes a data object filled with a given number of bytes of data from a given buffer, with a custom deallocator block.

Source

fn m_init_with_bytes_no_copy_length_free_when_done( &mut self, bytes: *mut c_void, length: UInt, b: bool, ) -> Self
where Self: Sized + FromId,

Initializes a newly allocated data object by adding the given number of bytes from the given buffer.

Source

fn m_init_with_data(&mut self, data: &NSData) -> Self
where Self: Sized + FromId,

Initializes a data object with the contents of another data object.

Source

fn m_data_with_contents_of_file(path: &NSString) -> Self
where Self: Sized + FromId,

Creates a data object by reading every byte from the file at a given path.

Source

fn m_data_with_contents_of_file_options( path: &NSString, read_options_mask: NSDataReadingOptions, ) -> Result<Self, NSError>
where Self: Sized + FromId,

Creates a data object by reading every byte from the file at a given path.

Source

fn m_data_with_contents_of_url(url: &NSURL) -> Self
where Self: Sized + FromId,

Creates a data object containing the data from the location specified by a given URL.

Source

fn m_data_with_contents_of_url_options( url: &NSURL, read_options_mask: NSDataReadingOptions, ) -> Result<Self, NSError>
where Self: Sized + FromId,

Creates a data object containing the data from the location specified by a given URL.

Source

fn m_init_with_contents_of_file(&mut self, path: &NSString) -> Self
where Self: Sized + FromId,

Initializes a data object with the content of the file at a given path.

Source

fn m_init_with_contents_of_file_options( &mut self, path: &NSString, read_options_mask: NSDataReadingOptions, ) -> Result<Self, NSError>
where Self: Sized + FromId,

Initializes a data object with the content of the file at a given path.

Source

fn m_init_with_contents_of_url(&mut self, url: &NSURL) -> Self
where Self: Sized + FromId,

Initializes a data object with the data from the location specified by a given URL.

Source

fn m_init_with_contents_of_url_options( &mut self, url: &NSURL, read_options_mask: NSDataReadingOptions, ) -> Result<Self, NSError>
where Self: Sized + FromId,

Initializes a data object with the data from the location specified by a given URL.

Source

fn m_write_to_file_atomically( &self, path: &NSString, use_auxiliary_file: bool, ) -> bool

Writes the data object’s bytes to the file specified by a given path.

Source

fn m_write_to_file_options( &self, path: &NSString, write_options: NSDataWritingOptions, ) -> Result<bool, NSError>

Writes the data object’s bytes to the file specified by a given path.

Source

fn m_write_to_url_atomically(&self, url: &NSURL, atomically: bool) -> bool

Writes the data object’s bytes to the location specified by a given URL.

Source

fn m_write_to_url_options( &self, url: &NSURL, write_options: NSDataWritingOptions, ) -> Result<bool, NSError>

Writes the data object’s bytes to the location specified by a given URL.

Source

fn m_init_with_base64_encoded_data_options( &mut self, base64_data: &NSData, options: NSDataBase64DecodingOptions, ) -> Self
where Self: Sized + FromId,

Initializes a data object with the given Base64 encoded data.

Source

fn m_init_with_base64_encoded_string_options( &mut self, base64_string: &NSString, options: NSDataBase64DecodingOptions, ) -> Self
where Self: Sized + FromId,

Initializes a data object with the given Base64 encoded string.

Source

fn m_base64_encoded_data_with_options( &self, options: NSDataBase64EncodingOptions, ) -> NSData

Creates a Base64, UTF-8 encoded data object from the string using the given options.

Source

fn m_base64_encoded_string_with_options( &self, options: NSDataBase64EncodingOptions, ) -> NSString

Creates a Base64 encoded string from the string using the given options.

Source

fn p_bytes(&self) -> *const c_void

A pointer to the data object’s contents.

Source

fn m_enumerate_byte_ranges_using_block<F>(&self, block: F)
where F: IntoConcreteBlock<(*const c_void, NSRange, *mut bool), Ret = ()> + 'static,

Enumerates each range of bytes in the data object using a block.

Source

fn m_get_bytes_length(&self, buffer: *mut c_void, length: UInt)

Copies a number of bytes from the start of the data object into a given buffer.

Source

fn m_get_bytes_range(&self, buffer: *mut c_void, range: NSRange)

Copies a range of bytes from the data object into a given buffer.

Source

fn m_subdata_with_range(&self, range: NSRange) -> NSData

Returns a new data object containing the data object’s bytes that fall within the limits specified by a given range.

Source

fn m_range_of_data_options_range( &self, data_to_find: &NSData, mask: NSDataSearchOptions, search_range: NSRange, ) -> NSRange

Finds and returns the range of the first occurrence of the given data, within the given range, subject to given options.

Source

fn m_is_equal_to_data(&self, other: &NSData) -> bool

Returns a Boolean value indicating whether this data object is the same as another.

Source

fn m_length(&self) -> UInt

The number of bytes contained by the data object.

Source

fn m_compressed_data_using_algorithm( &self, algorithm: NSDataCompressionAlgorithm, ) -> Result<Self, NSError>
where Self: Sized + FromId,

Returns a new data object by compressing the data object’s bytes.

Source

fn m_decompressed_data_using_algorithm( &self, algorithm: NSDataCompressionAlgorithm, ) -> Result<Self, NSError>
where Self: Sized + FromId,

Returns a new data object by decompressing data object’s bytes.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§