pub struct CFMutableData { /* private fields */ }Available on crate feature
CFData only.Expand description
This is toll-free bridged with NSMutableData.
Implementations§
Source§impl CFMutableData
impl CFMutableData
pub fn new( allocator: Option<&CFAllocator>, capacity: CFIndex, ) -> Option<CFRetained<CFMutableData>>
Sourcepub unsafe fn new_copy(
allocator: Option<&CFAllocator>,
capacity: CFIndex,
the_data: Option<&CFData>,
) -> Option<CFRetained<CFMutableData>>
pub unsafe fn new_copy( allocator: Option<&CFAllocator>, capacity: CFIndex, the_data: Option<&CFData>, ) -> Option<CFRetained<CFMutableData>>
§Safety
allocatormight not allowNone.the_datamight not allowNone.
Source§impl CFMutableData
impl CFMutableData
pub fn mutable_byte_ptr(the_data: Option<&CFMutableData>) -> *mut u8
Source§impl CFMutableData
impl CFMutableData
pub fn set_length(the_data: Option<&CFMutableData>, length: CFIndex)
pub fn increase_length(the_data: Option<&CFMutableData>, extra_length: CFIndex)
Sourcepub unsafe fn append_bytes(
the_data: Option<&CFMutableData>,
bytes: *const u8,
length: CFIndex,
)
pub unsafe fn append_bytes( the_data: Option<&CFMutableData>, bytes: *const u8, length: CFIndex, )
§Safety
the_datamight not allowNone.bytesmust be a valid pointer.
Sourcepub unsafe fn replace_bytes(
the_data: Option<&CFMutableData>,
range: CFRange,
new_bytes: *const u8,
new_length: CFIndex,
)
pub unsafe fn replace_bytes( the_data: Option<&CFMutableData>, range: CFRange, new_bytes: *const u8, new_length: CFIndex, )
§Safety
the_datamight not allowNone.new_bytesmust be a valid pointer.
pub fn delete_bytes(the_data: Option<&CFMutableData>, range: CFRange)
Methods from Deref<Target = CFData>§
Sourcepub unsafe fn as_bytes_unchecked(&self) -> &[u8] ⓘ
pub unsafe fn as_bytes_unchecked(&self) -> &[u8] ⓘ
Sourcepub fn to_vec(&self) -> Vec<u8> ⓘ
Available on crate feature alloc only.
pub fn to_vec(&self) -> Vec<u8> ⓘ
alloc only.Copy the contents of the CFData into a new Vec.
pub fn length(&self) -> CFIndex
pub fn byte_ptr(&self) -> *const u8
Methods from Deref<Target = CFType>§
Sourcepub fn downcast_ref<T: ConcreteType>(&self) -> Option<&T>
pub fn downcast_ref<T: ConcreteType>(&self) -> Option<&T>
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.
Sourcepub fn retain_count(&self) -> usize
pub fn retain_count(&self) -> usize
Get the reference count of the object.
This function may be useful for debugging. You normally do not use this function otherwise.
Beware that some things (like CFNumbers, small CFStrings etc.) may
not have a normal retain count for optimization purposes, and can
return usize::MAX in that case.
Trait Implementations§
Source§impl AsRef<AnyObject> for CFMutableData
impl AsRef<AnyObject> for CFMutableData
Source§impl AsRef<CFData> for CFMutableData
impl AsRef<CFData> for CFMutableData
Source§impl AsRef<CFMutableData> for CFMutableData
impl AsRef<CFMutableData> for CFMutableData
Source§impl AsRef<CFType> for CFMutableData
impl AsRef<CFType> for CFMutableData
Source§impl Borrow<AnyObject> for CFMutableData
impl Borrow<AnyObject> for CFMutableData
Source§impl Borrow<CFData> for CFMutableData
impl Borrow<CFData> for CFMutableData
Source§impl Borrow<CFType> for CFMutableData
impl Borrow<CFType> for CFMutableData
Source§impl Debug for CFMutableData
impl Debug for CFMutableData
Source§impl Deref for CFMutableData
impl Deref for CFMutableData
Source§impl Hash for CFMutableData
impl Hash for CFMutableData
Source§impl Message for CFMutableData
impl Message for CFMutableData
Source§impl PartialEq for CFMutableData
impl PartialEq for CFMutableData
Source§impl RefEncode for CFMutableData
impl RefEncode for CFMutableData
Source§const ENCODING_REF: Encoding
const ENCODING_REF: Encoding
The Objective-C type-encoding for a reference of this type. Read more
Source§impl Type for CFMutableData
impl Type for CFMutableData
Source§fn retain(&self) -> CFRetained<Self> ⓘwhere
Self: Sized,
fn retain(&self) -> CFRetained<Self> ⓘwhere
Self: Sized,
Increment the reference count of the receiver. Read more
Source§fn as_concrete_TypeRef(&self) -> &Self
fn as_concrete_TypeRef(&self) -> &Self
👎Deprecated: this is redundant
Helper for easier transition from the
core-foundation crate.Source§unsafe fn wrap_under_get_rule(ptr: *const Self) -> CFRetained<Self> ⓘwhere
Self: Sized,
unsafe fn wrap_under_get_rule(ptr: *const Self) -> CFRetained<Self> ⓘwhere
Self: Sized,
👎Deprecated: use CFRetained::retain
Helper for easier transition from the
core-foundation crate. Read moreSource§fn as_CFTypeRef(&self) -> &CFType
fn as_CFTypeRef(&self) -> &CFType
👎Deprecated: this is redundant (CF types deref to CFType)
Helper for easier transition from the
core-foundation crate.Source§unsafe fn wrap_under_create_rule(ptr: *const Self) -> CFRetained<Self> ⓘwhere
Self: Sized,
unsafe fn wrap_under_create_rule(ptr: *const Self) -> CFRetained<Self> ⓘwhere
Self: Sized,
👎Deprecated: use CFRetained::from_raw
Helper for easier transition from the
core-foundation crate. Read moreimpl Eq for CFMutableData
Auto Trait Implementations§
impl !Freeze for CFMutableData
impl !RefUnwindSafe for CFMutableData
impl !Send for CFMutableData
impl !Sync for CFMutableData
impl !Unpin for CFMutableData
impl !UnwindSafe for CFMutableData
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