Struct plist::dictionary::Dictionary [−][src]
pub struct Dictionary { /* fields omitted */ }
Expand description
Represents a plist dictionary type.
Implementations
Returns a reference to the value corresponding to the key.
Returns true if the dictionary contains a value for the specified key.
Returns a mutable reference to the value corresponding to the key.
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.
Removes a key from the dictionary, returning the value at the key if the key was previously in the dictionary.
Scan through each key-value pair in the map and keep those where the
closure keep
returns true
.
Sort the dictionary keys.
This uses the default ordering defined on str
.
This function is useful if you are serializing to XML, and wish to ensure a consistent key order.
Gets an iterator over the entries of the dictionary.
Gets a mutable iterator over the entries of the dictionary.
Gets an iterator over the keys of the dictionary.
Gets an iterator over the values of the dictionary.
Trait Implementations
Deserialize this value from the given Serde deserializer. Read more
Extends a collection with the contents of an iterator. Read more
extend_one
)Extends a collection with exactly one element.
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
Performs the conversion.
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,
}
Mutably access an element of this dictionary. Panics if the given key is not present in the dictionary.
dict["key"] = "value".into();
Auto Trait Implementations
impl RefUnwindSafe for Dictionary
impl Send for Dictionary
impl Sync for Dictionary
impl Unpin for Dictionary
impl UnwindSafe for Dictionary
Blanket Implementations
Mutably borrows from an owned value. Read more