pub struct Dictionary<K = Object, V = Object> { /* private fields */ }Expand description
An Objective-C dictionary object.
C++ equivalent: NS::Dictionary
Implementations§
Source§impl<K, V> Dictionary<K, V>
impl<K, V> Dictionary<K, V>
Sourcepub fn dictionary() -> Option<Self>
pub fn dictionary() -> Option<Self>
Create an empty dictionary.
C++ equivalent: static Dictionary* dictionary()
Sourcepub fn dictionary_with_object(object: *const V, key: *const K) -> Option<Self>
pub fn dictionary_with_object(object: *const V, key: *const K) -> Option<Self>
Create a dictionary with a single object and key.
C++ equivalent: static Dictionary* dictionary(const Object* pObject, const Object* pKey)
Sourcepub fn dictionary_with_objects(
objects: *const *const V,
keys: *const *const K,
count: UInteger,
) -> Option<Self>
pub fn dictionary_with_objects( objects: *const *const V, keys: *const *const K, count: UInteger, ) -> Option<Self>
Create a dictionary with multiple objects and keys.
C++ equivalent: static Dictionary* dictionary(const Object* const* pObjects, const Object* const* pKeys, UInteger count)
Sourcepub fn alloc() -> Option<Self>
pub fn alloc() -> Option<Self>
Allocate a new dictionary.
C++ equivalent: static Dictionary* alloc()
Sourcepub fn init(&self) -> Option<Self>
pub fn init(&self) -> Option<Self>
Initialize an allocated dictionary.
C++ equivalent: Dictionary* init()
Sourcepub fn init_with_objects(
&self,
objects: *const *const V,
keys: *const *const K,
count: UInteger,
) -> Option<Self>
pub fn init_with_objects( &self, objects: *const *const V, keys: *const *const K, count: UInteger, ) -> Option<Self>
Initialize with multiple objects and keys.
C++ equivalent: Dictionary* init(const Object* const* pObjects, const Object* const* pKeys, UInteger count)
Sourcepub fn init_with_coder(&self, coder: *const c_void) -> Option<Self>
pub fn init_with_coder(&self, coder: *const c_void) -> Option<Self>
Initialize with a coder.
C++ equivalent: Dictionary* init(const class Coder* pCoder)
Sourcepub fn key_enumerator(&self) -> Option<Enumerator<K>>
pub fn key_enumerator(&self) -> Option<Enumerator<K>>
Get a key enumerator for the dictionary.
C++ equivalent: template <class _KeyType = Object> Enumerator<_KeyType>* keyEnumerator() const
Sourcepub fn object(&self, key: *const K) -> *mut V
pub fn object(&self, key: *const K) -> *mut V
Get the object for the specified key.
C++ equivalent: template <class _Object = Object> _Object* object(const Object* pKey) const