pub struct CFBag<T: ?Sized = Opaque> { /* private fields */ }Available on crate feature
CFBag only.Expand description
Implementations§
Source§impl CFBag
impl CFBag
Sourcepub unsafe fn new(
allocator: Option<&CFAllocator>,
values: *mut *const c_void,
num_values: CFIndex,
call_backs: *const CFBagCallBacks,
) -> Option<CFRetained<CFBag>>
pub unsafe fn new( allocator: Option<&CFAllocator>, values: *mut *const c_void, num_values: CFIndex, call_backs: *const CFBagCallBacks, ) -> Option<CFRetained<CFBag>>
§Safety
allocatormight not allowNone.valuesmust be a valid pointer.call_backsmust be a valid pointer.
Sourcepub unsafe fn new_copy(
allocator: Option<&CFAllocator>,
the_bag: Option<&CFBag>,
) -> Option<CFRetained<CFBag>>
pub unsafe fn new_copy( allocator: Option<&CFAllocator>, the_bag: Option<&CFBag>, ) -> Option<CFRetained<CFBag>>
§Safety
allocatormight not allowNone.the_baggeneric must be of the correct type.the_bagmight not allowNone.
Source§impl CFBag
impl CFBag
Sourcepub unsafe fn count_of_value(&self, value: *const c_void) -> CFIndex
pub unsafe fn count_of_value(&self, value: *const c_void) -> CFIndex
§Safety
the_baggeneric must be of the correct type.valuemust be a valid pointer.
Sourcepub unsafe fn contains_value(&self, value: *const c_void) -> bool
pub unsafe fn contains_value(&self, value: *const c_void) -> bool
§Safety
the_baggeneric must be of the correct type.valuemust be a valid pointer.
Sourcepub unsafe fn value(&self, value: *const c_void) -> *const c_void
pub unsafe fn value(&self, value: *const c_void) -> *const c_void
§Safety
the_baggeneric must be of the correct type.valuemust be a valid pointer.
Sourcepub unsafe fn value_if_present(
&self,
candidate: *const c_void,
value: *mut *const c_void,
) -> bool
pub unsafe fn value_if_present( &self, candidate: *const c_void, value: *mut *const c_void, ) -> bool
§Safety
the_baggeneric must be of the correct type.candidatemust be a valid pointer.valuemust be a valid pointer.
Sourcepub unsafe fn values(&self, values: *mut *const c_void)
pub unsafe fn values(&self, values: *mut *const c_void)
§Safety
the_baggeneric must be of the correct type.valuesmust be a valid pointer.
Sourcepub unsafe fn apply_function(
&self,
applier: CFBagApplierFunction,
context: *mut c_void,
)
pub unsafe fn apply_function( &self, applier: CFBagApplierFunction, context: *mut c_void, )
§Safety
the_baggeneric must be of the correct type.appliermust be implemented correctly.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 ConcreteType for CFBag
impl ConcreteType for CFBag
Source§impl<T: ?Sized> RefEncode for CFBag<T>
impl<T: ?Sized> RefEncode for CFBag<T>
Source§const ENCODING_REF: Encoding
const ENCODING_REF: Encoding
The Objective-C type-encoding for a reference of this type. Read more
Source§impl<T: ?Sized> Type for CFBag<T>
impl<T: ?Sized> Type for CFBag<T>
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<T: ?Sized> Eq for CFBag<T>
Auto Trait Implementations§
impl<T = Opaque> !Freeze for CFBag<T>
impl<T = Opaque> !RefUnwindSafe for CFBag<T>
impl<T = Opaque> !Send for CFBag<T>
impl<T = Opaque> !Sync for CFBag<T>
impl<T = Opaque> !Unpin for CFBag<T>
impl<T = Opaque> !UnwindSafe for CFBag<T>
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