Struct core_graphics::data_provider::CGDataProvider
source · pub struct CGDataProvider(_);
Implementations
sourceimpl CGDataProvider
impl CGDataProvider
pub fn type_id() -> CFTypeID
sourcepub fn from_buffer(buffer: Arc<Vec<u8>>) -> Self
pub fn from_buffer(buffer: Arc<Vec<u8>>) -> Self
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.
sourcepub unsafe fn from_slice(buffer: &[u8]) -> Self
pub unsafe fn from_slice(buffer: &[u8]) -> Self
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.
sourcepub unsafe fn from_custom_data(custom_data: Box<Box<dyn CustomData>>) -> Self
pub unsafe fn from_custom_data(custom_data: Box<Box<dyn CustomData>>) -> Self
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>
Trait Implementations
sourceimpl AsRef<CGDataProviderRef> for CGDataProvider
impl AsRef<CGDataProviderRef> for CGDataProvider
sourcefn as_ref(&self) -> &CGDataProviderRef
fn as_ref(&self) -> &CGDataProviderRef
Converts this type into a shared reference of the (usually inferred) input type.
sourceimpl Borrow<CGDataProviderRef> for CGDataProvider
impl Borrow<CGDataProviderRef> for CGDataProvider
sourcefn borrow(&self) -> &CGDataProviderRef
fn borrow(&self) -> &CGDataProviderRef
Immutably borrows from an owned value. Read more
sourceimpl Clone for CGDataProvider
impl Clone for CGDataProvider
sourcefn clone(&self) -> CGDataProvider
fn clone(&self) -> CGDataProvider
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Deref for CGDataProvider
impl Deref for CGDataProvider
type Target = CGDataProviderRef
type Target = CGDataProviderRef
The resulting type after dereferencing.
sourcefn deref(&self) -> &CGDataProviderRef
fn deref(&self) -> &CGDataProviderRef
Dereferences the value.
sourceimpl DerefMut for CGDataProvider
impl DerefMut for CGDataProvider
sourcefn deref_mut(&mut self) -> &mut CGDataProviderRef
fn deref_mut(&mut self) -> &mut CGDataProviderRef
Mutably dereferences the value.
Auto Trait Implementations
impl RefUnwindSafe for CGDataProvider
impl !Send for CGDataProvider
impl !Sync for CGDataProvider
impl Unpin for CGDataProvider
impl UnwindSafe for CGDataProvider
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more