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§
Sourcefn m_data_with_bytes_length(bytes: *const c_void, length: UInt) -> Self
fn m_data_with_bytes_length(bytes: *const c_void, length: UInt) -> Self
Creates a data object containing a given number of bytes copied from a given buffer.
Sourcefn m_data_with_bytes_no_copy_length(bytes: *mut c_void, length: UInt) -> Self
fn m_data_with_bytes_no_copy_length(bytes: *mut c_void, length: UInt) -> Self
Creates a data object that holds a given number of bytes from a given buffer.
Sourcefn m_data_with_bytes_no_copy_length_free_when_done(
bytes: *mut c_void,
length: UInt,
b: bool,
) -> Self
fn m_data_with_bytes_no_copy_length_free_when_done( bytes: *mut c_void, length: UInt, b: bool, ) -> Self
Creates a data object that holds a given number of bytes from a given buffer.
Sourcefn m_data_with_data(data: NSData) -> Self
fn m_data_with_data(data: NSData) -> Self
Creates a data object containing the contents of another data object.
Sourcefn m_init_with_bytes_length(
&mut self,
bytes: *const c_void,
length: UInt,
) -> Self
fn m_init_with_bytes_length( &mut self, bytes: *const c_void, length: UInt, ) -> Self
Initializes a data object filled with a given number of bytes copied from a given buffer.
Sourcefn m_init_with_bytes_no_copy_length(
&mut self,
bytes: *mut c_void,
length: UInt,
) -> Self
fn m_init_with_bytes_no_copy_length( &mut self, bytes: *mut c_void, length: UInt, ) -> Self
Initializes a data object filled with a given number of bytes of data from a given buffer.
Sourcefn m_init_with_bytes_no_copy_length_deallocator<F>(
&mut self,
bytes: *mut c_void,
length: UInt,
deallocator: F,
) -> Self
fn m_init_with_bytes_no_copy_length_deallocator<F>( &mut self, bytes: *mut c_void, length: UInt, deallocator: F, ) -> Self
Initializes a data object filled with a given number of bytes of data from a given buffer, with a custom deallocator block.
Sourcefn m_init_with_bytes_no_copy_length_free_when_done(
&mut self,
bytes: *mut c_void,
length: UInt,
b: bool,
) -> Self
fn m_init_with_bytes_no_copy_length_free_when_done( &mut self, bytes: *mut c_void, length: UInt, b: bool, ) -> Self
Initializes a newly allocated data object by adding the given number of bytes from the given buffer.
Sourcefn m_init_with_data(&mut self, data: &NSData) -> Self
fn m_init_with_data(&mut self, data: &NSData) -> Self
Initializes a data object with the contents of another data object.
Sourcefn m_data_with_contents_of_file(path: &NSString) -> Self
fn m_data_with_contents_of_file(path: &NSString) -> Self
Creates a data object by reading every byte from the file at a given path.
Sourcefn m_data_with_contents_of_file_options(
path: &NSString,
read_options_mask: NSDataReadingOptions,
) -> Result<Self, NSError>
fn m_data_with_contents_of_file_options( path: &NSString, read_options_mask: NSDataReadingOptions, ) -> Result<Self, NSError>
Creates a data object by reading every byte from the file at a given path.
Sourcefn m_data_with_contents_of_url(url: &NSURL) -> Self
fn m_data_with_contents_of_url(url: &NSURL) -> Self
Creates a data object containing the data from the location specified by a given URL.
Sourcefn m_data_with_contents_of_url_options(
url: &NSURL,
read_options_mask: NSDataReadingOptions,
) -> Result<Self, NSError>
fn m_data_with_contents_of_url_options( url: &NSURL, read_options_mask: NSDataReadingOptions, ) -> Result<Self, NSError>
Creates a data object containing the data from the location specified by a given URL.
Sourcefn m_init_with_contents_of_file(&mut self, path: &NSString) -> Self
fn m_init_with_contents_of_file(&mut self, path: &NSString) -> Self
Initializes a data object with the content of the file at a given path.
Sourcefn m_init_with_contents_of_file_options(
&mut self,
path: &NSString,
read_options_mask: NSDataReadingOptions,
) -> Result<Self, NSError>
fn m_init_with_contents_of_file_options( &mut self, path: &NSString, read_options_mask: NSDataReadingOptions, ) -> Result<Self, NSError>
Initializes a data object with the content of the file at a given path.
Sourcefn m_init_with_contents_of_url(&mut self, url: &NSURL) -> Self
fn m_init_with_contents_of_url(&mut self, url: &NSURL) -> Self
Initializes a data object with the data from the location specified by a given URL.
Sourcefn m_init_with_contents_of_url_options(
&mut self,
url: &NSURL,
read_options_mask: NSDataReadingOptions,
) -> Result<Self, NSError>
fn m_init_with_contents_of_url_options( &mut self, url: &NSURL, read_options_mask: NSDataReadingOptions, ) -> Result<Self, NSError>
Initializes a data object with the data from the location specified by a given URL.
Sourcefn m_write_to_file_atomically(
&self,
path: &NSString,
use_auxiliary_file: bool,
) -> bool
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.
Sourcefn m_write_to_file_options(
&self,
path: &NSString,
write_options: NSDataWritingOptions,
) -> Result<bool, NSError>
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.
Sourcefn m_write_to_url_atomically(&self, url: &NSURL, atomically: bool) -> bool
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.
Sourcefn m_write_to_url_options(
&self,
url: &NSURL,
write_options: NSDataWritingOptions,
) -> Result<bool, NSError>
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.
Sourcefn m_init_with_base64_encoded_data_options(
&mut self,
base64_data: &NSData,
options: NSDataBase64DecodingOptions,
) -> Self
fn m_init_with_base64_encoded_data_options( &mut self, base64_data: &NSData, options: NSDataBase64DecodingOptions, ) -> Self
Initializes a data object with the given Base64 encoded data.
Sourcefn m_init_with_base64_encoded_string_options(
&mut self,
base64_string: &NSString,
options: NSDataBase64DecodingOptions,
) -> Self
fn m_init_with_base64_encoded_string_options( &mut self, base64_string: &NSString, options: NSDataBase64DecodingOptions, ) -> Self
Initializes a data object with the given Base64 encoded string.
Sourcefn m_base64_encoded_data_with_options(
&self,
options: NSDataBase64EncodingOptions,
) -> NSData
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.
Sourcefn m_base64_encoded_string_with_options(
&self,
options: NSDataBase64EncodingOptions,
) -> NSString
fn m_base64_encoded_string_with_options( &self, options: NSDataBase64EncodingOptions, ) -> NSString
Creates a Base64 encoded string from the string using the given options.
Sourcefn m_enumerate_byte_ranges_using_block<F>(&self, block: F)
fn m_enumerate_byte_ranges_using_block<F>(&self, block: F)
Enumerates each range of bytes in the data object using a block.
Sourcefn m_get_bytes_length(&self, buffer: *mut c_void, length: UInt)
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.
Sourcefn m_get_bytes_range(&self, buffer: *mut c_void, range: NSRange)
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.
Sourcefn m_subdata_with_range(&self, range: NSRange) -> NSData
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.
Sourcefn m_range_of_data_options_range(
&self,
data_to_find: &NSData,
mask: NSDataSearchOptions,
search_range: NSRange,
) -> NSRange
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.
Sourcefn m_is_equal_to_data(&self, other: &NSData) -> bool
fn m_is_equal_to_data(&self, other: &NSData) -> bool
Returns a Boolean value indicating whether this data object is the same as another.
Sourcefn m_compressed_data_using_algorithm(
&self,
algorithm: NSDataCompressionAlgorithm,
) -> Result<Self, NSError>
fn m_compressed_data_using_algorithm( &self, algorithm: NSDataCompressionAlgorithm, ) -> Result<Self, NSError>
Returns a new data object by compressing the data object’s bytes.
Sourcefn m_decompressed_data_using_algorithm(
&self,
algorithm: NSDataCompressionAlgorithm,
) -> Result<Self, NSError>
fn m_decompressed_data_using_algorithm( &self, algorithm: NSDataCompressionAlgorithm, ) -> Result<Self, NSError>
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".