pub struct Dictionary(/* private fields */);Implementations§
Source§impl Dictionary
impl Dictionary
Sourcepub fn as_slice(&self) -> &[KeyValuePair]
pub fn as_slice(&self) -> &[KeyValuePair]
Returns a slice of all key-value pairs in the dictionary.
Sourcepub fn as_mut_slice(&mut self) -> &mut [KeyValuePair]
pub fn as_mut_slice(&mut self) -> &mut [KeyValuePair]
Returns a mutable slice of all key-value pairs in the dictionary.
Sourcepub fn get<Q>(&self, query: &Q) -> Option<&Object>
pub fn get<Q>(&self, query: &Q) -> Option<&Object>
Returns a reference to the value corresponding to the key.
Sourcepub fn get_index<Q>(&self, query: &Q) -> Option<usize>
pub fn get_index<Q>(&self, query: &Q) -> Option<usize>
Returns the index of the key-value pair corresponding to the key.
Sourcepub fn get_mut<Q>(&mut self, query: &Q) -> Option<&mut Object>
pub fn get_mut<Q>(&mut self, query: &Q) -> Option<&mut Object>
Returns a mutable reference to the value corresponding to the key.
Sourcepub fn iter(&self) -> DictIter<'_> ⓘ
pub fn iter(&self) -> DictIter<'_> ⓘ
Returns an iterator over the (String, Object) pairs of the
dictionary.
Sourcepub fn iter_mut(&mut self) -> DictIterMut<'_> ⓘ
pub fn iter_mut(&mut self) -> DictIterMut<'_> ⓘ
Returns a mutable iterator over the (String, Object) pairs of the
dictionary.
Sourcepub fn keys(&self) -> impl Iterator<Item = &String> + '_
pub fn keys(&self) -> impl Iterator<Item = &String> + '_
Returns an iterator over the keys of the dictionary.
Sourcepub fn non_owning(&self) -> NonOwning<'_, Self>
pub fn non_owning(&self) -> NonOwning<'_, Self>
Returns a non-owning version of this Array.
Sourcepub fn swap_remove(&mut self, index: usize) -> KeyValuePair
pub fn swap_remove(&mut self, index: usize) -> KeyValuePair
Removes a KeyValuePair from the Dictionary and returns it.
The removed pair is replaced by the last element of the dictionary.
§Panics
Panics if index is out of bounds.
Trait Implementations§
Source§impl Clone for Dictionary
impl Clone for Dictionary
Source§fn clone(&self) -> Dictionary
fn clone(&self) -> Dictionary
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Dictionary
impl Debug for Dictionary
Source§impl Default for Dictionary
impl Default for Dictionary
Source§fn default() -> Dictionary
fn default() -> Dictionary
Returns the “default value” for a type. Read more
Source§impl<K, V> Extend<(K, V)> for Dictionary
impl<K, V> Extend<(K, V)> for Dictionary
Source§fn extend<T: IntoIterator<Item = (K, V)>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = (K, V)>>(&mut self, iter: T)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
Source§impl From<Dictionary> for Object
impl From<Dictionary> for Object
Source§fn from(dictionary: Dictionary) -> Self
fn from(dictionary: Dictionary) -> Self
Converts to this type from the input type.
Source§impl<K, V> FromIterator<(K, V)> for Dictionary
impl<K, V> FromIterator<(K, V)> for Dictionary
Source§impl<S> Index<S> for Dictionary
impl<S> Index<S> for Dictionary
Source§impl<S> IndexMut<S> for Dictionary
impl<S> IndexMut<S> for Dictionary
Source§impl IntoIterator for Dictionary
impl IntoIterator for Dictionary
Source§impl PartialEq for Dictionary
impl PartialEq for Dictionary
Source§impl Poppable for Dictionary
impl Poppable for Dictionary
Source§impl Pushable for Dictionary
impl Pushable for Dictionary
Source§impl TryFrom<Object> for Dictionary
impl TryFrom<Object> for Dictionary
impl StructuralPartialEq for Dictionary
Auto Trait Implementations§
impl Freeze for Dictionary
impl RefUnwindSafe for Dictionary
impl !Send for Dictionary
impl !Sync for Dictionary
impl Unpin for Dictionary
impl UnwindSafe for Dictionary
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FromObject for T
impl<T> FromObject for T
Source§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
Source§type Error = Infallible
type Error = Infallible
The error type in the returned
Result.Source§fn into_result(self) -> Result<T, <T as IntoResult<T>>::Error>
fn into_result(self) -> Result<T, <T as IntoResult<T>>::Error>
Converts the value into a
Result.