#[repr(C)]pub struct CFData { /* private fields */ }
Available on crate feature
CFData
only.Expand description
Implementations§
Source§impl CFData
impl CFData
Sourcepub fn from_bytes(bytes: &[u8]) -> CFRetained<Self> ⓘ
Available on crate feature CFBase
only.
pub fn from_bytes(bytes: &[u8]) -> CFRetained<Self> ⓘ
CFBase
only.Creates a new CFData
from a byte slice.
Sourcepub fn from_static_bytes(bytes: &'static [u8]) -> CFRetained<Self> ⓘ
Available on crate feature CFBase
only.
pub fn from_static_bytes(bytes: &'static [u8]) -> CFRetained<Self> ⓘ
CFBase
only.Creates a new CFData
from a 'static
byte slice.
This may be slightly more efficient than CFData::from_bytes
, as it
may be able to re-use the existing buffer (since we know it won’t be
deallocated).
Sourcepub fn len(&self) -> usize
Available on crate feature CFBase
only.
pub fn len(&self) -> usize
CFBase
only.The number of bytes contained by the CFData
.
Sourcepub fn is_empty(&self) -> bool
Available on crate feature CFBase
only.
pub fn is_empty(&self) -> bool
CFBase
only.Whether the CFData
is empty.
Sourcepub unsafe fn as_bytes_unchecked(&self) -> &[u8] ⓘ
Available on crate feature CFBase
only.
pub unsafe fn as_bytes_unchecked(&self) -> &[u8] ⓘ
CFBase
only.Methods from Deref<Target = CFType>§
Sourcepub fn downcast_ref<T: ConcreteType>(&self) -> Option<&T>
Available on crate feature CFBase
only.
pub fn downcast_ref<T: ConcreteType>(&self) -> Option<&T>
CFBase
only.Attempt to downcast the type to that of type T
.
This is the reference-variant. Use CFRetained::downcast
if you
want to convert a retained type. See also ConcreteType
for more
details on which types support being converted to.
Trait Implementations§
Source§impl AsRef<CFData> for CFMutableData
impl AsRef<CFData> for CFMutableData
Source§impl Borrow<CFData> for CFMutableData
impl Borrow<CFData> for CFMutableData
Source§impl ConcreteType for CFData
Available on crate feature CFBase
only.
impl ConcreteType for CFData
Available on crate feature
CFBase
only.Source§impl RefEncode for CFData
impl RefEncode for CFData
Source§const ENCODING_REF: Encoding
const ENCODING_REF: Encoding
The Objective-C type-encoding for a reference of this type. Read more
impl Eq for CFData
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more