pub struct CFMutableSet(/* private fields */);Expand description
Safe wrapper around a retained Core Foundation CFMutableSet reference.
Implementations§
Source§impl CFMutableSet
impl CFMutableSet
Sourcepub unsafe fn from_raw(ptr: *mut c_void) -> Option<Self>
pub unsafe fn from_raw(ptr: *mut c_void) -> Option<Self>
Adopts a +1 retained CFMutableSet pointer and returns None for null.
§Safety
A non-null ptr must be a live CFMutableSet pointer of the exact dynamic type carrying one retain transferred to this wrapper. The caller must not release or separately adopt that transferred retain.
Sourcepub unsafe fn from_raw_borrowed(ptr: *mut c_void) -> Option<Self>
pub unsafe fn from_raw_borrowed(ptr: *mut c_void) -> Option<Self>
Retains a +0 borrowed CFMutableSet pointer and returns an owned wrapper.
§Safety
A non-null ptr must be a live CFMutableSet pointer of the exact dynamic type for the duration of the retain call.
Sourcepub const fn as_ptr(&self) -> *mut c_void
pub const fn as_ptr(&self) -> *mut c_void
Borrows the raw +0 Core Foundation pointer while self remains alive.
Sourcepub fn into_cf_type(self) -> CFType
pub fn into_cf_type(self) -> CFType
Consumes this wrapper and returns the erased CFType.
Source§impl CFMutableSet
impl CFMutableSet
Sourcepub fn with_callbacks(capacity: usize, callbacks: CFSetCallbacks) -> Self
pub fn with_callbacks(capacity: usize, callbacks: CFSetCallbacks) -> Self
Create an empty mutable set with explicit callback semantics.
Sourcepub fn from_values(values: &[&dyn AsCFType]) -> Self
pub fn from_values(values: &[&dyn AsCFType]) -> Self
Create a mutable 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 a mutable set from borrowed Core Foundation values with explicit callback semantics.
Sourcepub fn mutable_copy(&self, capacity: usize) -> Self
pub fn mutable_copy(&self, capacity: usize) -> Self
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).
Trait Implementations§
Source§impl AsCFType for CFMutableSet
impl AsCFType for CFMutableSet
Source§impl Clone for CFMutableSet
impl Clone for CFMutableSet
Source§fn clone(&self) -> CFMutableSet
fn clone(&self) -> CFMutableSet
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more