[][src]Struct core_graphics::data_provider::CGDataProvider

pub struct CGDataProvider(_);

Implementations

impl CGDataProvider[src]

pub fn type_id() -> CFTypeID[src]

pub fn from_buffer(buffer: Arc<Vec<u8>>) -> Self[src]

Creates a data provider from the given reference-counted buffer.

The CGDataProvider object takes ownership of the reference. Once the data provider is destroyed, the reference count of the buffer is automatically decremented.

pub unsafe fn from_slice(buffer: &[u8]) -> Self[src]

Creates a data prvider from a given slice. The data provider does not own the slice in this case, so it's up to the user to ensure the memory safety here.

pub unsafe fn from_custom_data(custom_data: Box<Box<dyn CustomData>>) -> Self[src]

Creates a data provider from the given raw pointer, length, and destructor function.

This is double-boxed because the Core Text API requires that the userdata be a single pointer.

Methods from Deref<Target = CGDataProviderRef>

pub fn copy_data(&self) -> CFData[src]

Creates a copy of the data from the underlying CFDataProviderRef.

Trait Implementations

impl AsRef<CGDataProviderRef> for CGDataProvider[src]

impl Borrow<CGDataProviderRef> for CGDataProvider[src]

impl Clone for CGDataProvider[src]

impl Deref for CGDataProvider[src]

type Target = CGDataProviderRef

The resulting type after dereferencing.

impl DerefMut for CGDataProvider[src]

impl Drop for CGDataProvider[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.