pub struct CFBag(/* private fields */);Expand description
Safe wrapper around a retained Core Foundation CFBag reference.
Implementations§
Source§impl CFBag
impl CFBag
Sourcepub fn from_raw(ptr: *mut c_void) -> Option<Self>
pub fn from_raw(ptr: *mut c_void) -> Option<Self>
Wraps a +1 retained CFBag pointer and returns None for null.
Sourcepub unsafe fn from_raw_retained(ptr: *mut c_void) -> Option<Self>
pub unsafe fn from_raw_retained(ptr: *mut c_void) -> Option<Self>
Retains a +0 borrowed CFBag pointer and wraps the resulting +1 reference.
§Safety
ptr must be NULL or a valid CFBag pointer.
Sourcepub fn into_cf_type(self) -> CFType
pub fn into_cf_type(self) -> CFType
Consumes this wrapper and returns the erased CFType.
Source§impl CFBag
impl CFBag
Sourcepub fn from_values(values: &[&dyn AsCFType]) -> Self
pub fn from_values(values: &[&dyn AsCFType]) -> Self
Create a bag from borrowed Core Foundation values.
Sourcepub fn count_of_value(&self, candidate: &dyn AsCFType) -> usize
pub fn count_of_value(&self, candidate: &dyn AsCFType) -> usize
Number of times candidate appears in the bag.
Trait Implementations§
impl Eq for CFBag
impl StructuralPartialEq for CFBag
Auto Trait Implementations§
impl Freeze for CFBag
impl RefUnwindSafe for CFBag
impl !Send for CFBag
impl !Sync for CFBag
impl Unpin for CFBag
impl UnsafeUnpin for CFBag
impl UnwindSafe for CFBag
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