pub struct CFMutableBag<T: ?Sized = Opaque> { /* private fields */ }
CFBag
only.Expand description
Implementations§
Source§impl<T: ?Sized> CFMutableBag<T>
impl<T: ?Sized> CFMutableBag<T>
Sourcepub unsafe fn cast_unchecked<NewT: ?Sized>(&self) -> &CFMutableBag<NewT>
pub unsafe fn cast_unchecked<NewT: ?Sized>(&self) -> &CFMutableBag<NewT>
Unchecked conversion of the generic parameter.
§Safety
The generic must be valid to reinterpret as the given type.
Sourcepub fn as_opaque(&self) -> &CFMutableBag
pub fn as_opaque(&self) -> &CFMutableBag
Convert to the opaque/untyped variant.
Source§impl CFMutableBag
impl CFMutableBag
Sourcepub unsafe fn new(
allocator: Option<&CFAllocator>,
capacity: CFIndex,
call_backs: *const CFBagCallBacks,
) -> Option<CFRetained<CFMutableBag>>
pub unsafe fn new( allocator: Option<&CFAllocator>, capacity: CFIndex, call_backs: *const CFBagCallBacks, ) -> Option<CFRetained<CFMutableBag>>
§Safety
allocator
might not allowNone
.call_backs
must be a valid pointer.- The returned generic must be of the correct type.
Sourcepub unsafe fn new_copy(
allocator: Option<&CFAllocator>,
capacity: CFIndex,
the_bag: Option<&CFBag>,
) -> Option<CFRetained<CFMutableBag>>
pub unsafe fn new_copy( allocator: Option<&CFAllocator>, capacity: CFIndex, the_bag: Option<&CFBag>, ) -> Option<CFRetained<CFMutableBag>>
§Safety
allocator
might not allowNone
.the_bag
generic must be of the correct type.the_bag
might not allowNone
.- The returned generic must be of the correct type.
Source§impl CFMutableBag
impl CFMutableBag
Sourcepub unsafe fn add_value(the_bag: Option<&CFMutableBag>, value: *const c_void)
pub unsafe fn add_value(the_bag: Option<&CFMutableBag>, value: *const c_void)
§Safety
the_bag
generic must be of the correct type.the_bag
might not allowNone
.value
must be a valid pointer.
Sourcepub unsafe fn replace_value(
the_bag: Option<&CFMutableBag>,
value: *const c_void,
)
pub unsafe fn replace_value( the_bag: Option<&CFMutableBag>, value: *const c_void, )
§Safety
the_bag
generic must be of the correct type.the_bag
might not allowNone
.value
must be a valid pointer.
Sourcepub unsafe fn set_value(the_bag: Option<&CFMutableBag>, value: *const c_void)
pub unsafe fn set_value(the_bag: Option<&CFMutableBag>, value: *const c_void)
§Safety
the_bag
generic must be of the correct type.the_bag
might not allowNone
.value
must be a valid pointer.
Sourcepub unsafe fn remove_value(the_bag: Option<&CFMutableBag>, value: *const c_void)
pub unsafe fn remove_value(the_bag: Option<&CFMutableBag>, value: *const c_void)
§Safety
the_bag
generic must be of the correct type.the_bag
might not allowNone
.value
must be a valid pointer.
Sourcepub unsafe fn remove_all_values(the_bag: Option<&CFMutableBag>)
pub unsafe fn remove_all_values(the_bag: Option<&CFMutableBag>)
§Safety
the_bag
generic must be of the correct type.the_bag
might not allowNone
.
Methods from Deref<Target = CFBag<T>>§
Sourcepub unsafe fn cast_unchecked<NewT: ?Sized>(&self) -> &CFBag<NewT>
pub unsafe fn cast_unchecked<NewT: ?Sized>(&self) -> &CFBag<NewT>
Unchecked conversion of the generic parameter.
§Safety
The generic must be valid to reinterpret as the given type.
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_bag
generic must be of the correct type.value
must 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_bag
generic must be of the correct type.value
must 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_bag
generic must be of the correct type.value
must 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_bag
generic must be of the correct type.candidate
must be a valid pointer.value
must 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_bag
generic must be of the correct type.values
must 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_bag
generic must be of the correct type.applier
must be implemented correctly.context
must 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 CFNumber
s, small CFString
s etc.) may
not have a normal retain count for optimization purposes, and can
return usize::MAX
in that case.
Trait Implementations§
Source§impl<T: ?Sized> AsRef<CFMutableBag<T>> for CFMutableBag<T>
impl<T: ?Sized> AsRef<CFMutableBag<T>> for CFMutableBag<T>
Source§impl<T: ?Sized> Debug for CFMutableBag<T>
impl<T: ?Sized> Debug for CFMutableBag<T>
Source§impl<T: ?Sized> Deref for CFMutableBag<T>
impl<T: ?Sized> Deref for CFMutableBag<T>
Source§impl<T: ?Sized> Hash for CFMutableBag<T>
impl<T: ?Sized> Hash for CFMutableBag<T>
Source§impl<T: ?Sized> Message for CFMutableBag<T>
impl<T: ?Sized> Message for CFMutableBag<T>
Source§impl<T: ?Sized> PartialEq for CFMutableBag<T>
impl<T: ?Sized> PartialEq for CFMutableBag<T>
Source§impl<T: ?Sized> RefEncode for CFMutableBag<T>
impl<T: ?Sized> RefEncode for CFMutableBag<T>
Source§const ENCODING_REF: Encoding
const ENCODING_REF: Encoding
Source§impl<T: ?Sized> Type for CFMutableBag<T>
impl<T: ?Sized> Type for CFMutableBag<T>
Source§fn retain(&self) -> CFRetained<Self> ⓘwhere
Self: Sized,
fn retain(&self) -> CFRetained<Self> ⓘwhere
Self: Sized,
Source§fn as_concrete_TypeRef(&self) -> &Self
fn as_concrete_TypeRef(&self) -> &Self
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,
core-foundation
crate. Read moreSource§fn as_CFTypeRef(&self) -> &CFType
fn as_CFTypeRef(&self) -> &CFType
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,
core-foundation
crate. Read more