Struct CFData

Source
pub struct CFData(/* private fields */);
Expand description

This provides support for data objects, object-oriented wrappers for byte buffer

Implementations§

Source§

impl CFData

Source

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

Source

pub unsafe fn create_copy(allocator: CFAllocatorRef, data: CFDataRef) -> CFData

Creates an immutable copy of a CFData object.

§Safety

This function dereferences a raw pointer

Source

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

Source

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

Source

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

Source

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

Source

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

Source

pub fn get_type_id() -> CFTypeID

Returns the type identifier for the CFData opaque type.

Trait Implementations§

Source§

impl CFTypeObject for CFData

Source§

type Ref = *const __CFData

Source§

fn get_internal_object(&self) -> Self::Ref

Retrieves the internal object
Source§

fn create_with_ref(obj: Self::Ref) -> Self

Source§

impl Debug for CFData

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Drop for CFData

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl From<&[u8]> for CFData

Source§

fn from(value: &[u8]) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl Freeze for CFData

§

impl RefUnwindSafe for CFData

§

impl !Send for CFData

§

impl !Sync for CFData

§

impl Unpin for CFData

§

impl UnwindSafe for CFData

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.