pub struct CFData(/* private fields */);
Expand description
This provides support for data objects, object-oriented wrappers for byte buffer
Implementations§
Source§impl CFData
impl CFData
Sourcepub unsafe fn create(
allocator: CFAllocatorRef,
bytes: *const UInt8,
length: CFIndex,
) -> CFData
pub unsafe fn create( allocator: CFAllocatorRef, bytes: *const UInt8, length: CFIndex, ) -> CFData
Creates an immutable CFData object using data copied from a specified byte buffer.
§Safety
This function dereferences a raw pointer
Sourcepub unsafe fn create_copy(allocator: CFAllocatorRef, data: CFDataRef) -> CFData
pub unsafe fn create_copy(allocator: CFAllocatorRef, data: CFDataRef) -> CFData
Sourcepub unsafe fn create_with_bytes_no_copy(
allocator: CFAllocatorRef,
bytes: *const UInt8,
length: CFIndex,
bytes_deallocator: CFAllocatorRef,
) -> CFData
pub unsafe fn create_with_bytes_no_copy( allocator: CFAllocatorRef, bytes: *const UInt8, length: CFIndex, bytes_deallocator: CFAllocatorRef, ) -> CFData
Creates an immutable CFData object from an external (client-owned) byte buffer.
§Safety
This function dereferences a raw pointer
Sourcepub unsafe fn get_byte_ptr(data: CFDataRef) -> *const UInt8
pub unsafe fn get_byte_ptr(data: CFDataRef) -> *const UInt8
Returns a read-only pointer to the bytes of a CFData object.
§Safety
This function dereferences a raw pointer
Sourcepub unsafe fn get_bytes(data: CFDataRef, range: CFRange, buffer: *mut u8)
pub unsafe fn get_bytes(data: CFDataRef, range: CFRange, buffer: *mut u8)
Copies the byte contents of a CFData object to an external buffer.
§Safety
This function dereferences a raw pointer
Sourcepub unsafe fn get_length(data: CFDataRef) -> CFIndex
pub unsafe fn get_length(data: CFDataRef) -> CFIndex
Returns the number of bytes contained by a CFData object.
§Safety
This function dereferences a raw pointer
Sourcepub unsafe fn find(
data: CFDataRef,
data_to_find: CFDataRef,
search_range: CFRange,
compare_options: CFDataSearchFlags,
) -> CFRange
pub unsafe fn find( data: CFDataRef, data_to_find: CFDataRef, search_range: CFRange, compare_options: CFDataSearchFlags, ) -> CFRange
Finds and returns the range within a data object of the first occurrence of the given data, within a given range, subject to any given options.
§Safety
This function dereferences a raw pointer
Sourcepub fn get_type_id() -> CFTypeID
pub fn get_type_id() -> CFTypeID
Returns the type identifier for the CFData opaque type.