[−][src]Struct creator_plist::dictionary::Dictionary
Represents a plist dictionary type.
Implementations
impl Dictionary
[src]
pub fn new() -> Self
[src]
Makes a new empty Dictionary
.
pub fn clear(&mut self)
[src]
Clears the dictionary, removing all values.
pub fn get(&self, key: &str) -> Option<&Value>
[src]
Returns a reference to the value corresponding to the key.
pub fn contains_key(&self, key: &str) -> bool
[src]
Returns true if the dictionary contains a value for the specified key.
pub fn get_mut(&mut self, key: &str) -> Option<&mut Value>
[src]
Returns a mutable reference to the value corresponding to the key.
pub fn insert(&mut self, k: String, v: Value) -> Option<Value>
[src]
Inserts a key-value pair into the dictionary.
If the dictionary did not have this key present, None
is returned.
If the dictionary did have this key present, the value is updated, and the old value is returned.
pub fn remove(&mut self, key: &str) -> Option<Value>
[src]
Removes a key from the dictionary, returning the value at the key if the key was previously in the dictionary.
pub fn len(&self) -> usize
[src]
Returns the number of elements in the dictionary.
pub fn is_empty(&self) -> bool
[src]
Returns true if the dictionary contains no elements.
pub fn iter(&self) -> Iter<'_>ⓘ
[src]
Gets an iterator over the entries of the dictionary.
pub fn iter_mut(&mut self) -> IterMut<'_>ⓘ
[src]
Gets a mutable iterator over the entries of the dictionary.
pub fn keys(&self) -> Keys<'_>ⓘ
[src]
Gets an iterator over the keys of the dictionary.
pub fn values(&self) -> Values<'_>ⓘ
[src]
Gets an iterator over the values of the dictionary.
pub fn values_mut(&mut self) -> ValuesMut<'_>ⓘ
[src]
Gets an iterator over mutable values of the dictionary.
Trait Implementations
impl Clone for Dictionary
[src]
pub fn clone(&self) -> Self
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for Dictionary
[src]
impl Default for Dictionary
[src]
impl Extend<(String, Value)> for Dictionary
[src]
pub fn extend<T>(&mut self, iter: T) where
T: IntoIterator<Item = (String, Value)>,
[src]
T: IntoIterator<Item = (String, Value)>,
pub fn extend_one(&mut self, item: A)
[src]
pub fn extend_reserve(&mut self, additional: usize)
[src]
impl From<Dictionary> for Value
[src]
pub fn from(from: Dictionary) -> Value
[src]
impl FromIterator<(String, Value)> for Dictionary
[src]
impl<'a> Index<&'a str> for Dictionary
[src]
Access an element of this dictionary. Panics if the given key is not present in the dictionary.
match *val { Value::Array(ref arr) => arr[0].as_string(), Value::Dictionary(ref dict) => dict["type"].as_string(), Value::String(ref s) => Some(s.as_str()), _ => None, }
type Output = Value
The returned type after indexing.
pub fn index(&self, index: &str) -> &Value
[src]
impl<'a> IndexMut<&'a str> for Dictionary
[src]
Mutably access an element of this dictionary. Panics if the given key is not present in the dictionary.
dict["key"] = "value".into();
impl<'a> IntoIterator for &'a Dictionary
[src]
type Item = (&'a String, &'a Value)
The type of the elements being iterated over.
type IntoIter = Iter<'a>
Which kind of iterator are we turning this into?
pub fn into_iter(self) -> Self::IntoIter
[src]
impl<'a> IntoIterator for &'a mut Dictionary
[src]
type Item = (&'a String, &'a mut Value)
The type of the elements being iterated over.
type IntoIter = IterMut<'a>
Which kind of iterator are we turning this into?
pub fn into_iter(self) -> Self::IntoIter
[src]
impl IntoIterator for Dictionary
[src]
type Item = (String, Value)
The type of the elements being iterated over.
type IntoIter = IntoIter
Which kind of iterator are we turning this into?
pub fn into_iter(self) -> Self::IntoIter
[src]
impl PartialEq<Dictionary> for Dictionary
[src]
Auto Trait Implementations
impl RefUnwindSafe for Dictionary
[src]
impl Send for Dictionary
[src]
impl Sync for Dictionary
[src]
impl Unpin for Dictionary
[src]
impl UnwindSafe for Dictionary
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,