pub struct CFAllocator { /* private fields */ }Expand description
Implementations§
Source§impl CFAllocator
impl CFAllocator
pub fn set_default(allocator: Option<&CFAllocator>)
pub fn default() -> Option<CFRetained<CFAllocator>>
Sourcepub unsafe fn new(
allocator: Option<&CFAllocator>,
context: *mut CFAllocatorContext,
) -> Option<CFRetained<CFAllocator>>
pub unsafe fn new( allocator: Option<&CFAllocator>, context: *mut CFAllocatorContext, ) -> Option<CFRetained<CFAllocator>>
§Safety
allocatormight not allowNone.contextmust be a valid pointer.
Sourcepub unsafe fn with_zone(
allocator: Option<&CFAllocator>,
zone: *mut malloc_zone_t,
) -> Option<CFRetained<CFAllocator>>
Available on crate feature libc only.
pub unsafe fn with_zone( allocator: Option<&CFAllocator>, zone: *mut malloc_zone_t, ) -> Option<CFRetained<CFAllocator>>
libc only.§Safety
allocatormight not allowNone.zonemust be a valid pointer.
Sourcepub unsafe fn allocate_typed(
allocator: Option<&CFAllocator>,
size: CFIndex,
descriptor: CFAllocatorTypeID,
hint: CFOptionFlags,
) -> *mut c_void
pub unsafe fn allocate_typed( allocator: Option<&CFAllocator>, size: CFIndex, descriptor: CFAllocatorTypeID, hint: CFOptionFlags, ) -> *mut c_void
§Safety
allocator might not allow None.
Sourcepub unsafe fn reallocate_typed(
allocator: Option<&CFAllocator>,
ptr: *mut c_void,
newsize: CFIndex,
descriptor: CFAllocatorTypeID,
hint: CFOptionFlags,
) -> *mut c_void
pub unsafe fn reallocate_typed( allocator: Option<&CFAllocator>, ptr: *mut c_void, newsize: CFIndex, descriptor: CFAllocatorTypeID, hint: CFOptionFlags, ) -> *mut c_void
§Safety
allocatormight not allowNone.ptrmust be a valid pointer.
pub fn allocate_bytes( allocator: Option<&CFAllocator>, size: CFIndex, hint: CFOptionFlags, ) -> *mut c_void
Sourcepub unsafe fn reallocate_bytes(
allocator: Option<&CFAllocator>,
ptr: *mut c_void,
newsize: CFIndex,
hint: CFOptionFlags,
) -> *mut c_void
pub unsafe fn reallocate_bytes( allocator: Option<&CFAllocator>, ptr: *mut c_void, newsize: CFIndex, hint: CFOptionFlags, ) -> *mut c_void
§Safety
allocatormight not allowNone.ptrmust be a valid pointer.
pub fn allocate( allocator: Option<&CFAllocator>, size: CFIndex, hint: CFOptionFlags, ) -> *mut c_void
Sourcepub unsafe fn reallocate(
allocator: Option<&CFAllocator>,
ptr: *mut c_void,
newsize: CFIndex,
hint: CFOptionFlags,
) -> *mut c_void
pub unsafe fn reallocate( allocator: Option<&CFAllocator>, ptr: *mut c_void, newsize: CFIndex, hint: CFOptionFlags, ) -> *mut c_void
§Safety
allocatormight not allowNone.ptrmust be a valid pointer.
Sourcepub unsafe fn deallocate(allocator: Option<&CFAllocator>, ptr: *mut c_void)
pub unsafe fn deallocate(allocator: Option<&CFAllocator>, ptr: *mut c_void)
§Safety
allocatormight not allowNone.ptrmust be a valid pointer.
pub fn preferred_size_for_size( allocator: Option<&CFAllocator>, size: CFIndex, hint: CFOptionFlags, ) -> CFIndex
Sourcepub unsafe fn context(
allocator: Option<&CFAllocator>,
context: *mut CFAllocatorContext,
)
pub unsafe fn context( allocator: Option<&CFAllocator>, context: *mut CFAllocatorContext, )
§Safety
allocatormight not allowNone.contextmust be a valid pointer.
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 CFAllocator
impl AsRef<AnyObject> for CFAllocator
Source§impl AsRef<CFAllocator> for CFAllocator
impl AsRef<CFAllocator> for CFAllocator
Source§impl AsRef<CFType> for CFAllocator
impl AsRef<CFType> for CFAllocator
Source§impl Borrow<AnyObject> for CFAllocator
impl Borrow<AnyObject> for CFAllocator
Source§impl Borrow<CFType> for CFAllocator
impl Borrow<CFType> for CFAllocator
Source§impl ConcreteType for CFAllocator
impl ConcreteType for CFAllocator
Source§impl Debug for CFAllocator
impl Debug for CFAllocator
Source§impl Deref for CFAllocator
impl Deref for CFAllocator
Source§impl Hash for CFAllocator
impl Hash for CFAllocator
Source§impl Message for CFAllocator
impl Message for CFAllocator
Source§impl PartialEq for CFAllocator
impl PartialEq for CFAllocator
Source§impl RefEncode for CFAllocator
impl RefEncode for CFAllocator
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 CFAllocator
impl Type for CFAllocator
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 CFAllocator
Auto Trait Implementations§
impl !Freeze for CFAllocator
impl !RefUnwindSafe for CFAllocator
impl !Send for CFAllocator
impl !Sync for CFAllocator
impl !Unpin for CFAllocator
impl UnsafeUnpin for CFAllocator
impl !UnwindSafe for CFAllocator
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