pub struct CFSet(/* private fields */);Expand description
Safe wrapper around a retained Core Foundation CFSet reference.
Implementations§
Source§impl CFSet
impl CFSet
Sourcepub fn from_raw(ptr: *mut c_void) -> Option<Self>
pub fn from_raw(ptr: *mut c_void) -> Option<Self>
Wraps a +1 retained CFSet 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 CFSet pointer and wraps the resulting +1 reference.
§Safety
ptr must be NULL or a valid CFSet 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 CFSet
impl CFSet
Sourcepub fn from_values(values: &[&dyn AsCFType]) -> Self
pub fn from_values(values: &[&dyn AsCFType]) -> Self
Create an immutable set from borrowed Core Foundation values using type callbacks.
Sourcepub fn from_values_with_callbacks(
values: &[&dyn AsCFType],
callbacks: CFSetCallbacks,
) -> Self
pub fn from_values_with_callbacks( values: &[&dyn AsCFType], callbacks: CFSetCallbacks, ) -> Self
Create an immutable set from borrowed Core Foundation values with explicit callback semantics.
Sourcepub fn mutable_copy(&self, capacity: usize) -> CFMutableSet
pub fn mutable_copy(&self, capacity: usize) -> CFMutableSet
Create a mutable retained copy of this set.
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 set (0 or 1).
Sourcepub fn get(&self, candidate: &dyn AsCFType) -> Option<CFType>
pub fn get(&self, candidate: &dyn AsCFType) -> Option<CFType>
Copy a matching value using CFSetGetValue semantics.
Sourcepub fn get_if_present(&self, candidate: &dyn AsCFType) -> Option<CFType>
pub fn get_if_present(&self, candidate: &dyn AsCFType) -> Option<CFType>
Copy a matching value using CFSetGetValueIfPresent semantics.
Trait Implementations§
impl Eq for CFSet
impl StructuralPartialEq for CFSet
Auto Trait Implementations§
impl Freeze for CFSet
impl RefUnwindSafe for CFSet
impl !Send for CFSet
impl !Sync for CFSet
impl Unpin for CFSet
impl UnsafeUnpin for CFSet
impl UnwindSafe for CFSet
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