Struct pencil::datastructures::MultiDict
[−]
[src]
pub struct MultiDict<T> { // some fields omitted }
This is used to deal with multiple values for the same key.
Methods
impl<T> MultiDict<T>
[src]
fn new() -> MultiDict<T>
fn get(&self, key: &str) -> Option<&T>
Return the first value for this key.
fn set(&mut self, key: &str, value: T)
Removes an existing key first and add the value.
fn add(&mut self, key: String, value: T)
Adds a new value for the key.
fn getlist(&self, key: &str) -> Option<&Vec<T>>
Return the list of items for a given key.
fn iter<'a>(&'a self) -> MultiDictIter<'a, T>
An iterator of (key, value)
pairs.
The value will be first value of each key.
fn listiter<'a>(&'a self) -> Iter<'a, String, Vec<T>>
An iterator of (key, values)
pairs.
fn keys<'a>(&'a self) -> Keys<'a, String, Vec<T>>
An iterator visiting all keys in arbitrary order.
fn values<'a>(&'a self) -> MultiDictValues<'a, T>
An iterator of the first value on every key's value list.
fn listvalues<'a>(&'a self) -> Values<'a, String, Vec<T>>
An iterator of all values corresponding to a key.
Trait Implementations
impl<T: Clone> Clone for MultiDict<T>
[src]
fn clone(&self) -> MultiDict<T>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more