pub struct NSDictionary<KeyType: ?Sized = AnyObject, ObjectType: ?Sized = AnyObject> { /* private fields */ }NSDictionary only.Expand description
************** Immutable Dictionary ***************
See also Apple’s documentation
Implementations§
Source§impl<KeyType: Message, ObjectType: Message> NSDictionary<KeyType, ObjectType>
Convenience creation methods.
impl<KeyType: Message, ObjectType: Message> NSDictionary<KeyType, ObjectType>
Convenience creation methods.
Sourcepub fn from_slices<CopiedKey>(
keys: &[&CopiedKey],
objects: &[&ObjectType],
) -> Retained<Self>
Available on crate feature NSObject only.
pub fn from_slices<CopiedKey>( keys: &[&CopiedKey], objects: &[&ObjectType], ) -> Retained<Self>
NSObject only.Create a new dictionary from a slice of keys, and a slice of objects.
This is a safe interface to initWithObjects:forKeys:count:.
§Panics
Panics if the slices have different lengths, as this is likely a programmer error.
§Example
use objc2_foundation::{NSDictionary, ns_string};
let dict = NSDictionary::from_slices(
&[ns_string!("key1"), ns_string!("key2"), ns_string!("key3")],
&[ns_string!("value1"), ns_string!("value2"), ns_string!("value3")],
);
assert_eq!(&*dict.objectForKey(ns_string!("key2")).unwrap(), ns_string!("value2"));pub fn from_retained_objects<CopiedKey>( keys: &[&CopiedKey], objects: &[Retained<ObjectType>], ) -> Retained<Self>
NSObject only.Source§impl<KeyType: Message, ObjectType: Message> NSDictionary<KeyType, ObjectType>
Direct, unsafe object accessors.
impl<KeyType: Message, ObjectType: Message> NSDictionary<KeyType, ObjectType>
Direct, unsafe object accessors.
Foundation’s collection types store their items in such a way that they can give out references to their data without having to autorelease it first, see the docs.
This means that we can more efficiently access the dictionary’s keys and
objects, but only if the dictionary isn’t mutated via e.g.
NSMutableDictionary methods while doing so - otherwise, we might end up
accessing a deallocated object.
Sourcepub unsafe fn objectForKey_unchecked(
&self,
key: &KeyType,
) -> Option<&ObjectType>
pub unsafe fn objectForKey_unchecked( &self, key: &KeyType, ) -> Option<&ObjectType>
Get a direct reference to the object corresponding to the key.
Consider using the objectForKey method
instead, unless you’re seeing performance issues from the retaining.
§Safety
The dictionary must not be mutated while the reference is live.
Sourcepub unsafe fn to_vecs_unchecked(&self) -> (Vec<&KeyType>, Vec<&ObjectType>)
Available on crate feature alloc only.
pub unsafe fn to_vecs_unchecked(&self) -> (Vec<&KeyType>, Vec<&ObjectType>)
alloc only.Sourcepub unsafe fn keys_unchecked(&self) -> KeysUnchecked<'_, KeyType, ObjectType> ⓘ
Available on crate feature NSEnumerator only.
pub unsafe fn keys_unchecked(&self) -> KeysUnchecked<'_, KeyType, ObjectType> ⓘ
NSEnumerator only.Sourcepub unsafe fn objects_unchecked(
&self,
) -> ObjectsUnchecked<'_, KeyType, ObjectType> ⓘ
Available on crate feature NSEnumerator only.
pub unsafe fn objects_unchecked( &self, ) -> ObjectsUnchecked<'_, KeyType, ObjectType> ⓘ
NSEnumerator only.Source§impl<KeyType: Message, ObjectType: Message> NSDictionary<KeyType, ObjectType>
Various accessor methods.
impl<KeyType: Message, ObjectType: Message> NSDictionary<KeyType, ObjectType>
Various accessor methods.
Sourcepub fn to_vecs(&self) -> (Vec<Retained<KeyType>>, Vec<Retained<ObjectType>>)
Available on crate feature alloc only.
pub fn to_vecs(&self) -> (Vec<Retained<KeyType>>, Vec<Retained<ObjectType>>)
alloc only.Two vectors containing respectively the dictionary’s keys and objects.
§Example
Iterate over the keys and values of the dictionary.
use objc2_foundation::{NSDictionary, ns_string};
let dict = NSDictionary::from_slices(
&[ns_string!("a"), ns_string!("b")],
&[ns_string!("a"), ns_string!("b")],
);
let (keys, objects) = dict.to_vecs();
for (key, obj) in keys.into_iter().zip(objects) {
assert_eq!(key, obj);
}Sourcepub fn keys(&self) -> Keys<'_, KeyType, ObjectType> ⓘ
Available on crate feature NSEnumerator only.
pub fn keys(&self) -> Keys<'_, KeyType, ObjectType> ⓘ
NSEnumerator only.Iterate over the dictionary’s keys.
Sourcepub fn objects(&self) -> Objects<'_, KeyType, ObjectType> ⓘ
Available on crate feature NSEnumerator only.
pub fn objects(&self) -> Objects<'_, KeyType, ObjectType> ⓘ
NSEnumerator only.Iterate over the dictionary’s objects / values.
§Examples
use objc2_foundation::{ns_string, NSMutableDictionary, NSString};
let dict = NSMutableDictionary::new();
dict.insert(ns_string!("key1"), ns_string!("value1"));
dict.insert(ns_string!("key2"), ns_string!("value2"));
for obj in dict.objects() {
assert!(obj.hasPrefix(ns_string!("value")));
}Source§impl<ObjectType: Message> NSDictionary<NSString, ObjectType>
NSDictionaryCreation with known NSString key (because they load PLists).
impl<ObjectType: Message> NSDictionary<NSString, ObjectType>
NSDictionaryCreation with known NSString key (because they load PLists).
pub unsafe fn initWithContentsOfURL_error( this: Allocated<Self>, url: &NSURL, ) -> Result<Retained<Self>, Retained<NSError>>
NSString and NSError and NSURL only.pub unsafe fn dictionaryWithContentsOfURL_error( url: &NSURL, ) -> Result<Retained<Self>, Retained<NSError>>
NSString and NSError and NSURL only.Source§impl<KeyType: ?Sized + Message, ObjectType: ?Sized + Message> NSDictionary<KeyType, ObjectType>
impl<KeyType: ?Sized + Message, ObjectType: ?Sized + Message> NSDictionary<KeyType, ObjectType>
Sourcepub unsafe fn cast_unchecked<NewKeyType: ?Sized + Message, NewObjectType: ?Sized + Message>(
&self,
) -> &NSDictionary<NewKeyType, NewObjectType>
pub unsafe fn cast_unchecked<NewKeyType: ?Sized + Message, NewObjectType: ?Sized + Message>( &self, ) -> &NSDictionary<NewKeyType, NewObjectType>
Unchecked conversion of the generic parameters.
§Safety
The generics must be valid to reinterpret as the given types.
Source§impl<KeyType: Message, ObjectType: Message> NSDictionary<KeyType, ObjectType>
impl<KeyType: Message, ObjectType: Message> NSDictionary<KeyType, ObjectType>
pub fn count(&self) -> NSUInteger
pub fn objectForKey(&self, a_key: &KeyType) -> Option<Retained<ObjectType>>
Sourcepub unsafe fn keyEnumerator(&self) -> Retained<NSEnumerator<KeyType>>
Available on crate feature NSEnumerator only.
pub unsafe fn keyEnumerator(&self) -> Retained<NSEnumerator<KeyType>>
NSEnumerator only.§Safety
The returned enumerator’s underlying collection should not be mutated while in use.
pub fn init(this: Allocated<Self>) -> Retained<Self>
Sourcepub unsafe fn initWithObjects_forKeys_count(
this: Allocated<Self>,
objects: *mut NonNull<ObjectType>,
keys: *mut NonNull<ProtocolObject<dyn NSCopying>>,
cnt: NSUInteger,
) -> Retained<Self>
Available on crate feature NSObject only.
pub unsafe fn initWithObjects_forKeys_count( this: Allocated<Self>, objects: *mut NonNull<ObjectType>, keys: *mut NonNull<ProtocolObject<dyn NSCopying>>, cnt: NSUInteger, ) -> Retained<Self>
NSObject only.§Safety
objectsmust be a valid pointer or null.keysmust be a valid pointer or null.
Source§impl<KeyType: Message, ObjectType: Message> NSDictionary<KeyType, ObjectType>
Methods declared on superclass NSObject.
impl<KeyType: Message, ObjectType: Message> NSDictionary<KeyType, ObjectType>
Methods declared on superclass NSObject.
Source§impl<KeyType: Message, ObjectType: Message> NSDictionary<KeyType, ObjectType>
NSExtendedDictionary.
impl<KeyType: Message, ObjectType: Message> NSDictionary<KeyType, ObjectType>
NSExtendedDictionary.
pub fn allKeys(&self) -> Retained<NSArray<KeyType>>
NSArray only.pub fn allKeysForObject( &self, an_object: &ObjectType, ) -> Retained<NSArray<KeyType>>
NSArray only.pub fn allValues(&self) -> Retained<NSArray<ObjectType>>
NSArray only.pub fn description(&self) -> Retained<NSString>
NSString only.pub fn descriptionInStringsFileFormat(&self) -> Retained<NSString>
NSString only.Sourcepub unsafe fn descriptionWithLocale(
&self,
locale: Option<&AnyObject>,
) -> Retained<NSString>
Available on crate feature NSString only.
pub unsafe fn descriptionWithLocale( &self, locale: Option<&AnyObject>, ) -> Retained<NSString>
NSString only.§Safety
locale should be of the correct type.
Sourcepub unsafe fn descriptionWithLocale_indent(
&self,
locale: Option<&AnyObject>,
level: NSUInteger,
) -> Retained<NSString>
Available on crate feature NSString only.
pub unsafe fn descriptionWithLocale_indent( &self, locale: Option<&AnyObject>, level: NSUInteger, ) -> Retained<NSString>
NSString only.§Safety
locale should be of the correct type.
pub fn isEqualToDictionary( &self, other_dictionary: &NSDictionary<KeyType, ObjectType>, ) -> bool
Sourcepub unsafe fn objectEnumerator(&self) -> Retained<NSEnumerator<ObjectType>>
Available on crate feature NSEnumerator only.
pub unsafe fn objectEnumerator(&self) -> Retained<NSEnumerator<ObjectType>>
NSEnumerator only.§Safety
The returned enumerator’s underlying collection should not be mutated while in use.
pub fn objectsForKeys_notFoundMarker( &self, keys: &NSArray<KeyType>, marker: &ObjectType, ) -> Retained<NSArray<ObjectType>>
NSArray only.pub unsafe fn writeToURL_error( &self, url: &NSURL, ) -> Result<(), Retained<NSError>>
NSError and NSURL only.Sourcepub unsafe fn keysSortedByValueUsingSelector(
&self,
comparator: Sel,
) -> Retained<NSArray<KeyType>>
Available on crate feature NSArray only.
pub unsafe fn keysSortedByValueUsingSelector( &self, comparator: Sel, ) -> Retained<NSArray<KeyType>>
NSArray only.§Safety
comparator must be a valid selector.
Sourcepub unsafe fn getObjects_andKeys_count(
&self,
objects: *mut NonNull<ObjectType>,
keys: *mut NonNull<KeyType>,
count: NSUInteger,
)
pub unsafe fn getObjects_andKeys_count( &self, objects: *mut NonNull<ObjectType>, keys: *mut NonNull<KeyType>, count: NSUInteger, )
§Safety
objectsmust be a valid pointer or null.keysmust be a valid pointer or null.
pub fn objectForKeyedSubscript( &self, key: &KeyType, ) -> Option<Retained<ObjectType>>
pub fn enumerateKeysAndObjectsUsingBlock( &self, block: &DynBlock<dyn Fn(NonNull<KeyType>, NonNull<ObjectType>, NonNull<Bool>) + '_>, )
block2 only.pub fn enumerateKeysAndObjectsWithOptions_usingBlock( &self, opts: NSEnumerationOptions, block: &DynBlock<dyn Fn(NonNull<KeyType>, NonNull<ObjectType>, NonNull<Bool>) + '_>, )
NSObjCRuntime and block2 only.Sourcepub unsafe fn keysSortedByValueUsingComparator(
&self,
cmptr: NSComparator,
) -> Retained<NSArray<KeyType>>
Available on crate features NSArray and NSObjCRuntime and block2 only.
pub unsafe fn keysSortedByValueUsingComparator( &self, cmptr: NSComparator, ) -> Retained<NSArray<KeyType>>
NSArray and NSObjCRuntime and block2 only.§Safety
cmptr must be a valid pointer.
Sourcepub unsafe fn keysSortedByValueWithOptions_usingComparator(
&self,
opts: NSSortOptions,
cmptr: NSComparator,
) -> Retained<NSArray<KeyType>>
Available on crate features NSArray and NSObjCRuntime and block2 only.
pub unsafe fn keysSortedByValueWithOptions_usingComparator( &self, opts: NSSortOptions, cmptr: NSComparator, ) -> Retained<NSArray<KeyType>>
NSArray and NSObjCRuntime and block2 only.§Safety
cmptr must be a valid pointer.
pub fn keysOfEntriesPassingTest( &self, predicate: &DynBlock<dyn Fn(NonNull<KeyType>, NonNull<ObjectType>, NonNull<Bool>) -> Bool + '_>, ) -> Retained<NSSet<KeyType>>
NSSet and block2 only.pub fn keysOfEntriesWithOptions_passingTest( &self, opts: NSEnumerationOptions, predicate: &DynBlock<dyn Fn(NonNull<KeyType>, NonNull<ObjectType>, NonNull<Bool>) -> Bool + '_>, ) -> Retained<NSSet<KeyType>>
NSObjCRuntime and NSSet and block2 only.Source§impl<KeyType: Message, ObjectType: Message> NSDictionary<KeyType, ObjectType>
NSDeprecated.
impl<KeyType: Message, ObjectType: Message> NSDictionary<KeyType, ObjectType>
NSDeprecated.
Sourcepub unsafe fn getObjects_andKeys(
&self,
objects: *mut NonNull<ObjectType>,
keys: *mut NonNull<KeyType>,
)
👎Deprecated: Use -getObjects:andKeys:count: instead
pub unsafe fn getObjects_andKeys( &self, objects: *mut NonNull<ObjectType>, keys: *mut NonNull<KeyType>, )
This method is unsafe because it could potentially cause buffer overruns. You should use -getObjects:andKeys:count:
§Safety
objectsmust be a valid pointer or null.keysmust be a valid pointer or null.
pub unsafe fn dictionaryWithContentsOfFile( path: &NSString, ) -> Option<Retained<NSDictionary<KeyType, ObjectType>>>
NSString only.pub unsafe fn dictionaryWithContentsOfURL( url: &NSURL, ) -> Option<Retained<NSDictionary<KeyType, ObjectType>>>
NSURL only.pub unsafe fn initWithContentsOfFile( this: Allocated<Self>, path: &NSString, ) -> Option<Retained<NSDictionary<KeyType, ObjectType>>>
NSString only.pub unsafe fn initWithContentsOfURL( this: Allocated<Self>, url: &NSURL, ) -> Option<Retained<NSDictionary<KeyType, ObjectType>>>
NSURL only.pub unsafe fn writeToFile_atomically( &self, path: &NSString, use_auxiliary_file: bool, ) -> bool
NSString only.pub unsafe fn writeToURL_atomically( &self, url: &NSURL, atomically: bool, ) -> bool
NSURL only.Source§impl<KeyType: Message, ObjectType: Message> NSDictionary<KeyType, ObjectType>
NSDictionaryCreation.
impl<KeyType: Message, ObjectType: Message> NSDictionary<KeyType, ObjectType>
NSDictionaryCreation.
pub fn dictionary() -> Retained<Self>
Sourcepub unsafe fn dictionaryWithObject_forKey(
object: &ObjectType,
key: &ProtocolObject<dyn NSCopying>,
) -> Retained<Self>
Available on crate feature NSObject only.
pub unsafe fn dictionaryWithObject_forKey( object: &ObjectType, key: &ProtocolObject<dyn NSCopying>, ) -> Retained<Self>
NSObject only.§Safety
key should be of the correct type.
Sourcepub unsafe fn dictionaryWithObjects_forKeys_count(
objects: *mut NonNull<ObjectType>,
keys: *mut NonNull<ProtocolObject<dyn NSCopying>>,
cnt: NSUInteger,
) -> Retained<Self>
Available on crate feature NSObject only.
pub unsafe fn dictionaryWithObjects_forKeys_count( objects: *mut NonNull<ObjectType>, keys: *mut NonNull<ProtocolObject<dyn NSCopying>>, cnt: NSUInteger, ) -> Retained<Self>
NSObject only.§Safety
objectsmust be a valid pointer or null.keysmust be a valid pointer or null.
pub fn dictionaryWithDictionary( dict: &NSDictionary<KeyType, ObjectType>, ) -> Retained<Self>
Sourcepub unsafe fn dictionaryWithObjects_forKeys(
objects: &NSArray<ObjectType>,
keys: &NSArray<ProtocolObject<dyn NSCopying>>,
) -> Retained<Self>
Available on crate features NSArray and NSObject only.
pub unsafe fn dictionaryWithObjects_forKeys( objects: &NSArray<ObjectType>, keys: &NSArray<ProtocolObject<dyn NSCopying>>, ) -> Retained<Self>
NSArray and NSObject only.§Safety
keys generic should be of the correct type.
pub fn initWithDictionary( this: Allocated<Self>, other_dictionary: &NSDictionary<KeyType, ObjectType>, ) -> Retained<Self>
pub unsafe fn initWithDictionary_copyItems( this: Allocated<Self>, other_dictionary: &NSDictionary<KeyType, ObjectType>, flag: bool, ) -> Retained<Self>
Sourcepub unsafe fn initWithObjects_forKeys(
this: Allocated<Self>,
objects: &NSArray<ObjectType>,
keys: &NSArray<ProtocolObject<dyn NSCopying>>,
) -> Retained<Self>
Available on crate features NSArray and NSObject only.
pub unsafe fn initWithObjects_forKeys( this: Allocated<Self>, objects: &NSArray<ObjectType>, keys: &NSArray<ProtocolObject<dyn NSCopying>>, ) -> Retained<Self>
NSArray and NSObject only.§Safety
keys generic should be of the correct type.
Source§impl<KeyType: Message, ObjectType: Message> NSDictionary<KeyType, ObjectType>
NSSharedKeySetDictionary.
impl<KeyType: Message, ObjectType: Message> NSDictionary<KeyType, ObjectType>
NSSharedKeySetDictionary.
Available on crate features NSArray and NSObject only.
NSArray and NSObject only.§Safety
keys generic should be of the correct type.
Source§impl<KeyType: Message, ObjectType: Message> NSDictionary<KeyType, ObjectType>
NSFileAttributes.
impl<KeyType: Message, ObjectType: Message> NSDictionary<KeyType, ObjectType>
NSFileAttributes.
pub fn fileSize(&self) -> c_ulonglong
NSFileManager only.pub fn fileModificationDate(&self) -> Option<Retained<NSDate>>
NSFileManager and NSDate only.pub fn fileType(&self) -> Option<Retained<NSString>>
NSFileManager and NSString only.pub fn filePosixPermissions(&self) -> NSUInteger
NSFileManager only.pub fn fileOwnerAccountName(&self) -> Option<Retained<NSString>>
NSFileManager and NSString only.pub fn fileGroupOwnerAccountName(&self) -> Option<Retained<NSString>>
NSFileManager and NSString only.pub fn fileSystemNumber(&self) -> NSInteger
NSFileManager only.pub fn fileSystemFileNumber(&self) -> NSUInteger
NSFileManager only.pub fn fileExtensionHidden(&self) -> bool
NSFileManager only.pub fn fileHFSCreatorCode(&self) -> u32
NSFileManager only.pub fn fileHFSTypeCode(&self) -> u32
NSFileManager only.pub fn fileIsImmutable(&self) -> bool
NSFileManager only.pub fn fileIsAppendOnly(&self) -> bool
NSFileManager only.pub fn fileCreationDate(&self) -> Option<Retained<NSDate>>
NSFileManager and NSDate only.pub fn fileOwnerAccountID(&self) -> Option<Retained<NSNumber>>
NSFileManager and NSValue only.pub fn fileGroupOwnerAccountID(&self) -> Option<Retained<NSNumber>>
NSFileManager and NSValue only.Source§impl<KeyType: Message, ObjectType: Message> NSDictionary<KeyType, ObjectType>
NSKeyValueCoding.
impl<KeyType: Message, ObjectType: Message> NSDictionary<KeyType, ObjectType>
NSKeyValueCoding.
pub fn valueForKey(&self, key: &NSString) -> Option<Retained<ObjectType>>
NSKeyValueCoding and NSString only.Methods from Deref<Target = NSObject>§
Sourcepub fn doesNotRecognizeSelector(&self, sel: Sel) -> !
pub fn doesNotRecognizeSelector(&self, sel: Sel) -> !
Handle messages the object doesn’t recognize.
See Apple’s documentation for details.
Methods from Deref<Target = AnyObject>§
Sourcepub fn class(&self) -> &'static AnyClass
pub fn class(&self) -> &'static AnyClass
Dynamically find the class of this object.
§Panics
May panic if the object is invalid (which may be the case for objects
returned from unavailable init/new methods).
§Example
Check that an instance of NSObject has the precise class NSObject.
use objc2::ClassType;
use objc2::runtime::NSObject;
let obj = NSObject::new();
assert_eq!(obj.class(), NSObject::class());Sourcepub unsafe fn get_ivar<T>(&self, name: &str) -> &Twhere
T: Encode,
👎Deprecated: this is difficult to use correctly, use Ivar::load instead.
pub unsafe fn get_ivar<T>(&self, name: &str) -> &Twhere
T: Encode,
Ivar::load instead.Use Ivar::load instead.
§Safety
The object must have an instance variable with the given name, and it
must be of type T.
See Ivar::load_ptr for details surrounding this.
Sourcepub fn downcast_ref<T>(&self) -> Option<&T>where
T: DowncastTarget,
pub fn downcast_ref<T>(&self) -> Option<&T>where
T: DowncastTarget,
Attempt to downcast the object to a class of type T.
This is the reference-variant. Use Retained::downcast if you want
to convert a retained object to another type.
§Mutable classes
Some classes have immutable and mutable variants, such as NSString
and NSMutableString.
When some Objective-C API signature says it gives you an immutable class, it generally expects you to not mutate that, even though it may technically be mutable “under the hood”.
So using this method to convert a NSString to a NSMutableString,
while not unsound, is generally frowned upon unless you created the
string yourself, or the API explicitly documents the string to be
mutable.
See Apple’s documentation on mutability and on
isKindOfClass: for more details.
§Generic classes
Objective-C generics are called “lightweight generics”, and that’s because they aren’t exposed in the runtime. This makes it impossible to safely downcast to generic collections, so this is disallowed by this method.
You can, however, safely downcast to generic collections where all the
type-parameters are AnyObject.
§Panics
This works internally by calling isKindOfClass:. That means that the
object must have the instance method of that name, and an exception
will be thrown (if CoreFoundation is linked) or the process will abort
if that is not the case. In the vast majority of cases, you don’t need
to worry about this, since both root objects NSObject and
NSProxy implement this method.
§Examples
Cast an NSString back and forth from NSObject.
use objc2::rc::Retained;
use objc2_foundation::{NSObject, NSString};
let obj: Retained<NSObject> = NSString::new().into_super();
let string = obj.downcast_ref::<NSString>().unwrap();
// Or with `downcast`, if we do not need the object afterwards
let string = obj.downcast::<NSString>().unwrap();Try (and fail) to cast an NSObject to an NSString.
use objc2_foundation::{NSObject, NSString};
let obj = NSObject::new();
assert!(obj.downcast_ref::<NSString>().is_none());Try to cast to an array of strings.
use objc2_foundation::{NSArray, NSObject, NSString};
let arr = NSArray::from_retained_slice(&[NSObject::new()]);
// This is invalid and doesn't type check.
let arr = arr.downcast_ref::<NSArray<NSString>>();This fails to compile, since it would require enumerating over the array to ensure that each element is of the desired type, which is a performance pitfall.
Downcast when processing each element instead.
use objc2_foundation::{NSArray, NSObject, NSString};
let arr = NSArray::from_retained_slice(&[NSObject::new()]);
for elem in arr {
if let Some(data) = elem.downcast_ref::<NSString>() {
// handle `data`
}
}Trait Implementations§
Source§impl<KeyType: ?Sized + Message, ObjectType: ?Sized + Message> AsRef<AnyObject> for NSDictionary<KeyType, ObjectType>
impl<KeyType: ?Sized + Message, ObjectType: ?Sized + Message> AsRef<AnyObject> for NSDictionary<KeyType, ObjectType>
Source§impl<KeyType: ?Sized + Message, ObjectType: ?Sized + Message> AsRef<CFDictionary<KeyType, ObjectType>> for NSDictionary<KeyType, ObjectType>
Available on crate feature objc2-core-foundation only.
impl<KeyType: ?Sized + Message, ObjectType: ?Sized + Message> AsRef<CFDictionary<KeyType, ObjectType>> for NSDictionary<KeyType, ObjectType>
objc2-core-foundation only.Source§fn as_ref(&self) -> &CFDictionary<KeyType, ObjectType>
fn as_ref(&self) -> &CFDictionary<KeyType, ObjectType>
Source§impl<KeyType: ?Sized + Message, ObjectType: ?Sized + Message> AsRef<NSDictionary<KeyType, ObjectType>> for CFDictionary<KeyType, ObjectType>
Available on crate feature objc2-core-foundation only.
impl<KeyType: ?Sized + Message, ObjectType: ?Sized + Message> AsRef<NSDictionary<KeyType, ObjectType>> for CFDictionary<KeyType, ObjectType>
objc2-core-foundation only.Source§fn as_ref(&self) -> &NSDictionary<KeyType, ObjectType>
fn as_ref(&self) -> &NSDictionary<KeyType, ObjectType>
Source§impl<KeyType: ?Sized + Message, ObjectType: ?Sized + Message> AsRef<NSDictionary<KeyType, ObjectType>> for NSDictionary<KeyType, ObjectType>
impl<KeyType: ?Sized + Message, ObjectType: ?Sized + Message> AsRef<NSDictionary<KeyType, ObjectType>> for NSDictionary<KeyType, ObjectType>
Source§impl<KeyType: ?Sized + Message, ObjectType: ?Sized + Message> AsRef<NSDictionary<KeyType, ObjectType>> for NSMutableDictionary<KeyType, ObjectType>
impl<KeyType: ?Sized + Message, ObjectType: ?Sized + Message> AsRef<NSDictionary<KeyType, ObjectType>> for NSMutableDictionary<KeyType, ObjectType>
Source§fn as_ref(&self) -> &NSDictionary<KeyType, ObjectType>
fn as_ref(&self) -> &NSDictionary<KeyType, ObjectType>
Source§impl<KeyType: ?Sized + Message, ObjectType: ?Sized + Message> AsRef<NSObject> for NSDictionary<KeyType, ObjectType>
impl<KeyType: ?Sized + Message, ObjectType: ?Sized + Message> AsRef<NSObject> for NSDictionary<KeyType, ObjectType>
Source§impl<KeyType: ?Sized + Message, ObjectType: ?Sized + Message> Borrow<AnyObject> for NSDictionary<KeyType, ObjectType>
impl<KeyType: ?Sized + Message, ObjectType: ?Sized + Message> Borrow<AnyObject> for NSDictionary<KeyType, ObjectType>
Source§impl<KeyType: ?Sized + Message, ObjectType: ?Sized + Message> Borrow<NSDictionary<KeyType, ObjectType>> for NSMutableDictionary<KeyType, ObjectType>
impl<KeyType: ?Sized + Message, ObjectType: ?Sized + Message> Borrow<NSDictionary<KeyType, ObjectType>> for NSMutableDictionary<KeyType, ObjectType>
Source§fn borrow(&self) -> &NSDictionary<KeyType, ObjectType>
fn borrow(&self) -> &NSDictionary<KeyType, ObjectType>
Source§impl<KeyType: ?Sized + Message, ObjectType: ?Sized + Message> Borrow<NSObject> for NSDictionary<KeyType, ObjectType>
impl<KeyType: ?Sized + Message, ObjectType: ?Sized + Message> Borrow<NSObject> for NSDictionary<KeyType, ObjectType>
Source§impl<KeyType: ?Sized + Message, ObjectType: ?Sized + Message> ClassType for NSDictionary<KeyType, ObjectType>
impl<KeyType: ?Sized + Message, ObjectType: ?Sized + Message> ClassType for NSDictionary<KeyType, ObjectType>
Source§const NAME: &'static str = "NSDictionary"
const NAME: &'static str = "NSDictionary"
Source§type ThreadKind = <<NSDictionary<KeyType, ObjectType> as ClassType>::Super as ClassType>::ThreadKind
type ThreadKind = <<NSDictionary<KeyType, ObjectType> as ClassType>::Super as ClassType>::ThreadKind
Source§impl<KeyType: ?Sized + Message, ObjectType: ?Sized + Message> CopyingHelper for NSDictionary<KeyType, ObjectType>
Available on crate feature NSObject only.
impl<KeyType: ?Sized + Message, ObjectType: ?Sized + Message> CopyingHelper for NSDictionary<KeyType, ObjectType>
NSObject only.Source§type Result = NSDictionary<KeyType, ObjectType>
type Result = NSDictionary<KeyType, ObjectType>
Self if the type has no
immutable counterpart. Read moreSource§impl<KeyType: Debug + Message, ObjectType: Debug + Message> Debug for NSDictionary<KeyType, ObjectType>
impl<KeyType: Debug + Message, ObjectType: Debug + Message> Debug for NSDictionary<KeyType, ObjectType>
Source§impl<KeyType: Message, ObjectType: Message> DefaultRetained for NSDictionary<KeyType, ObjectType>
impl<KeyType: Message, ObjectType: Message> DefaultRetained for NSDictionary<KeyType, ObjectType>
Source§impl<KeyType: ?Sized + Message, ObjectType: ?Sized + Message> Deref for NSDictionary<KeyType, ObjectType>
impl<KeyType: ?Sized + Message, ObjectType: ?Sized + Message> Deref for NSDictionary<KeyType, ObjectType>
Source§impl<KeyType: ?Sized + Message, ObjectType: ?Sized + Message> Message for NSDictionary<KeyType, ObjectType>
impl<KeyType: ?Sized + Message, ObjectType: ?Sized + Message> Message for NSDictionary<KeyType, ObjectType>
Source§impl<KeyType: ?Sized + Message, ObjectType: ?Sized + Message> MutableCopyingHelper for NSDictionary<KeyType, ObjectType>
Available on crate feature NSObject only.
impl<KeyType: ?Sized + Message, ObjectType: ?Sized + Message> MutableCopyingHelper for NSDictionary<KeyType, ObjectType>
NSObject only.Source§type Result = NSMutableDictionary<KeyType, ObjectType>
type Result = NSMutableDictionary<KeyType, ObjectType>
Self if the type has no
mutable counterpart. Read moreSource§impl<KeyType: ?Sized + NSCoding, ObjectType: ?Sized + NSCoding> NSCoding for NSDictionary<KeyType, ObjectType>
impl<KeyType: ?Sized + NSCoding, ObjectType: ?Sized + NSCoding> NSCoding for NSDictionary<KeyType, ObjectType>
Source§unsafe fn encodeWithCoder(&self, coder: &NSCoder)
unsafe fn encodeWithCoder(&self, coder: &NSCoder)
NSObject and NSCoder only.Source§impl<KeyType: ?Sized, ObjectType: ?Sized> NSCopying for NSDictionary<KeyType, ObjectType>
impl<KeyType: ?Sized, ObjectType: ?Sized> NSCopying for NSDictionary<KeyType, ObjectType>
Source§impl<KeyType: ?Sized, ObjectType: ?Sized> NSFastEnumeration for NSDictionary<KeyType, ObjectType>
impl<KeyType: ?Sized, ObjectType: ?Sized> NSFastEnumeration for NSDictionary<KeyType, ObjectType>
Source§unsafe fn countByEnumeratingWithState_objects_count(
&self,
state: NonNull<NSFastEnumerationState>,
buffer: NonNull<*mut AnyObject>,
len: NSUInteger,
) -> NSUInteger
unsafe fn countByEnumeratingWithState_objects_count( &self, state: NonNull<NSFastEnumerationState>, buffer: NonNull<*mut AnyObject>, len: NSUInteger, ) -> NSUInteger
NSEnumerator only.Source§impl<KeyType: ?Sized, ObjectType: ?Sized> NSMutableCopying for NSDictionary<KeyType, ObjectType>
impl<KeyType: ?Sized, ObjectType: ?Sized> NSMutableCopying for NSDictionary<KeyType, ObjectType>
Source§impl<KeyType: ?Sized, ObjectType: ?Sized> NSObjectProtocol for NSDictionary<KeyType, ObjectType>
impl<KeyType: ?Sized, ObjectType: ?Sized> NSObjectProtocol for NSDictionary<KeyType, ObjectType>
Source§fn isEqual(&self, other: Option<&AnyObject>) -> bool
fn isEqual(&self, other: Option<&AnyObject>) -> bool
Source§fn hash(&self) -> usize
fn hash(&self) -> usize
Source§fn isKindOfClass(&self, cls: &AnyClass) -> bool
fn isKindOfClass(&self, cls: &AnyClass) -> bool
Source§fn is_kind_of<T>(&self) -> bool
fn is_kind_of<T>(&self) -> bool
isKindOfClass directly, or cast your objects with AnyObject::downcast_ref