Struct cacao::foundation::NSMutableDictionary
source · [−]Expand description
A wrapper for NSMutableDictionary
.
Tuple Fields
0: Id<Object>
Implementations
sourceimpl NSMutableDictionary
impl NSMutableDictionary
sourcepub fn new() -> Self
pub fn new() -> Self
Constructs an NSMutableDictionary
and retains it.
Why mutable? It’s just easier for working with it, as they’re (mostly) interchangeable when
passed around in Objective-C. We guard against mutation on our side using the standard Rust
object model. You can, of course, bypass it and msg_send![]
yourself, but it’d require an
unsafe {}
block… so you’ll know you’re in special territory then.
sourcepub fn insert(&mut self, key: NSString<'_>, object: id)
pub fn insert(&mut self, key: NSString<'_>, object: id)
Inserts an object into the backing NSMutablyDictionary.
This intentionally requires NSString
be allocated ahead of time.
sourcepub fn into_inner(self) -> id
pub fn into_inner(self) -> id
Consumes and returns the underlying NSMutableDictionary
.
Methods from Deref<Target = Object>
sourcepub unsafe fn get_ivar<T>(&self, name: &str) -> &T where
T: Encode,
pub unsafe fn get_ivar<T>(&self, name: &str) -> &T where
T: Encode,
Returns a reference to the ivar of self with the given name.
Panics if self has no ivar with the given name.
Unsafe because the caller must ensure that the ivar is actually
of type T
.
sourcepub unsafe fn get_mut_ivar<T>(&mut self, name: &str) -> &mut T where
T: Encode,
pub unsafe fn get_mut_ivar<T>(&mut self, name: &str) -> &mut T where
T: Encode,
Returns a mutable reference to the ivar of self with the given name.
Panics if self has no ivar with the given name.
Unsafe because the caller must ensure that the ivar is actually
of type T
.
Trait Implementations
sourceimpl Debug for NSMutableDictionary
impl Debug for NSMutableDictionary
sourceimpl Default for NSMutableDictionary
impl Default for NSMutableDictionary
sourceimpl Deref for NSMutableDictionary
impl Deref for NSMutableDictionary
sourceimpl DerefMut for NSMutableDictionary
impl DerefMut for NSMutableDictionary
Auto Trait Implementations
impl RefUnwindSafe for NSMutableDictionary
impl Send for NSMutableDictionary
impl Sync for NSMutableDictionary
impl Unpin for NSMutableDictionary
impl UnwindSafe for NSMutableDictionary
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more