Struct objc2_foundation::NSDictionary
source · [−]#[repr(C)]pub struct NSDictionary<K, V> { /* private fields */ }
Implementations
sourceimpl<K, V> NSDictionary<K, V>
impl<K, V> NSDictionary<K, V>
sourceimpl<K: Message, V: Message> NSDictionary<K, V>
impl<K: Message, V: Message> NSDictionary<K, V>
pub fn new() -> Id<Self, Shared>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn get(&self, key: &K) -> Option<&V>
pub fn keys(&self) -> Vec<&K>
pub fn values(&self) -> Vec<&V>
pub fn keys_and_objects(&self) -> (Vec<&K>, Vec<&V>)
pub fn iter_keys(&self) -> NSEnumerator<'_, K>ⓘNotable traits for NSEnumerator<'a, T>impl<'a, T: Message> Iterator for NSEnumerator<'a, T> type Item = &'a T;
pub fn iter_values(&self) -> NSEnumerator<'_, V>ⓘNotable traits for NSEnumerator<'a, T>impl<'a, T: Message> Iterator for NSEnumerator<'a, T> type Item = &'a T;
pub fn keys_array(&self) -> Id<NSArray<K, Shared>, Shared>
pub fn from_keys_and_objects<T>(
keys: &[&T],
vals: Vec<Id<V, Owned>>
) -> Id<Self, Shared> where
T: NSCopying<Output = K>,
pub fn into_values_array(dict: Id<Self, Owned>) -> Id<NSArray<V, Owned>, Shared>
Methods from Deref<Target = NSObject>
Methods from Deref<Target = Object>
sourcepub unsafe fn ivar<T>(&self, name: &str) -> &T where
T: Encode,
pub unsafe fn ivar<T>(&self, name: &str) -> &T where
T: Encode,
Returns a shared reference to the ivar with the given name.
Panics
Panics if the object has no ivar with the given name, or the type
encoding of the ivar differs from the type encoding of T
.
Safety
The caller must ensure that the ivar is actually of type T
.
Library implementors should expose a safe interface to the ivar.
sourcepub unsafe fn get_ivar<T>(&self, name: &str) -> &T where
T: Encode,
👎 Deprecated: Use Object::ivar
instead.
pub unsafe fn get_ivar<T>(&self, name: &str) -> &T where
T: Encode,
Use Object::ivar
instead.
sourcepub unsafe fn ivar_mut<T>(&mut self, name: &str) -> &mut T where
T: Encode,
pub unsafe fn ivar_mut<T>(&mut self, name: &str) -> &mut T where
T: Encode,
Returns a mutable reference to the ivar with the given name.
Panics
Panics if the object has no ivar with the given name, or the type
encoding of the ivar differs from the type encoding of T
.
Safety
The caller must ensure that the ivar is actually of type T
.
Library implementors should expose a safe interface to the ivar.
sourcepub unsafe fn get_mut_ivar<T>(&mut self, name: &str) -> &mut T where
T: Encode,
👎 Deprecated: Use Object::ivar_mut
instead.
pub unsafe fn get_mut_ivar<T>(&mut self, name: &str) -> &mut T where
T: Encode,
Use Object::ivar_mut
instead.
sourcepub unsafe fn set_ivar<T>(&mut self, name: &str, value: T) where
T: Encode,
pub unsafe fn set_ivar<T>(&mut self, name: &str, value: T) where
T: Encode,
Sets the value of the ivar with the given name.
Panics
Panics if the object has no ivar with the given name, or the type
encoding of the ivar differs from the type encoding of T
.
Safety
The caller must ensure that the ivar is actually of type T
.
Library implementors should expose a safe interface to the ivar.
Trait Implementations
sourceimpl<K, V> AsMut<NSDictionary<K, V>> for NSDictionary<K, V>
impl<K, V> AsMut<NSDictionary<K, V>> for NSDictionary<K, V>
sourceimpl<K, V> AsMut<NSObject> for NSDictionary<K, V>
impl<K, V> AsMut<NSObject> for NSDictionary<K, V>
sourceimpl<K, V> AsMut<Object> for NSDictionary<K, V>
impl<K, V> AsMut<Object> for NSDictionary<K, V>
sourceimpl<K, V> AsRef<NSDictionary<K, V>> for NSDictionary<K, V>
impl<K, V> AsRef<NSDictionary<K, V>> for NSDictionary<K, V>
sourceimpl<K, V> AsRef<NSObject> for NSDictionary<K, V>
impl<K, V> AsRef<NSObject> for NSDictionary<K, V>
sourceimpl<K, V> AsRef<Object> for NSDictionary<K, V>
impl<K, V> AsRef<Object> for NSDictionary<K, V>
sourceimpl<K, V> Borrow<NSObject> for NSDictionary<K, V>
impl<K, V> Borrow<NSObject> for NSDictionary<K, V>
sourceimpl<K, V> Borrow<Object> for NSDictionary<K, V>
impl<K, V> Borrow<Object> for NSDictionary<K, V>
sourceimpl<K, V> BorrowMut<NSObject> for NSDictionary<K, V>
impl<K, V> BorrowMut<NSObject> for NSDictionary<K, V>
sourcefn borrow_mut(&mut self) -> &mut NSObject
fn borrow_mut(&mut self) -> &mut NSObject
Mutably borrows from an owned value. Read more
sourceimpl<K, V> BorrowMut<Object> for NSDictionary<K, V>
impl<K, V> BorrowMut<Object> for NSDictionary<K, V>
sourcefn borrow_mut(&mut self) -> &mut Object
fn borrow_mut(&mut self) -> &mut Object
Mutably borrows from an owned value. Read more
sourceimpl<K, V> Debug for NSDictionary<K, V>
impl<K, V> Debug for NSDictionary<K, V>
sourceimpl<K: Message, V: Message> DefaultId for NSDictionary<K, V>
impl<K: Message, V: Message> DefaultId for NSDictionary<K, V>
sourceimpl<K, V> Deref for NSDictionary<K, V>
impl<K, V> Deref for NSDictionary<K, V>
sourceimpl<K, V> DerefMut for NSDictionary<K, V>
impl<K, V> DerefMut for NSDictionary<K, V>
sourceimpl<K: Hash, V: Hash> Hash for NSDictionary<K, V>
impl<K: Hash, V: Hash> Hash for NSDictionary<K, V>
sourceimpl<K: Message, V: Message> NSFastEnumeration for NSDictionary<K, V>
impl<K: Message, V: Message> NSFastEnumeration for NSDictionary<K, V>
type Item = K
fn iter_fast(&self) -> NSFastEnumerator<'_, Self>ⓘNotable traits for NSFastEnumerator<'a, C>impl<'a, C: NSFastEnumeration + ?Sized> Iterator for NSFastEnumerator<'a, C> type Item = &'a C::Item;
sourceimpl<K: PartialEq, V: PartialEq> PartialEq<NSDictionary<K, V>> for NSDictionary<K, V>
impl<K: PartialEq, V: PartialEq> PartialEq<NSDictionary<K, V>> for NSDictionary<K, V>
sourceimpl<K, V> RefEncode for NSDictionary<K, V>
impl<K, V> RefEncode for NSDictionary<K, V>
sourceconst ENCODING_REF: Encoding<'static> = ::objc2::Encoding::Object
const ENCODING_REF: Encoding<'static> = ::objc2::Encoding::Object
The Objective-C type-encoding for a reference of this type. Read more
impl<K: Eq, V: Eq> Eq for NSDictionary<K, V>
impl<K, V> Message for NSDictionary<K, V>
impl<K: Sync + Send, V: Send> Send for NSDictionary<K, V>
impl<K: Sync + Send, V: Sync> Sync for NSDictionary<K, V>
Auto Trait Implementations
impl<K, V> !RefUnwindSafe for NSDictionary<K, V>
impl<K, V> !Unpin for NSDictionary<K, V>
impl<K, V> !UnwindSafe for NSDictionary<K, V>
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