Struct bson::ordered::OrderedDocument
[−]
[src]
pub struct OrderedDocument { /* fields omitted */ }
A BSON document represented as an associative HashMap with insertion ordering.
Methods
impl OrderedDocument
[src]
fn new() -> OrderedDocument
Creates a new empty OrderedDocument.
fn iter<'a>(&'a self) -> OrderedDocumentIterator<'a>
Gets an iterator over the entries of the map.
fn clear(&mut self)
Clears the document, removing all values.
fn get(&self, key: &str) -> Option<&Bson>
Returns a reference to the Bson corresponding to the key.
fn get_mut(&mut self, key: &str) -> Option<&mut Bson>
Gets a mutable reference to the Bson corresponding to the key
fn get_f64(&self, key: &str) -> ValueAccessResult<f64>
Get a floating point value for this key if it exists and has the correct type.
fn get_str(&self, key: &str) -> ValueAccessResult<&str>
Get a string slice this key if it exists and has the correct type.
fn get_array(&self, key: &str) -> ValueAccessResult<&Array>
Get a reference to an array for this key if it exists and has the correct type.
fn get_document(&self, key: &str) -> ValueAccessResult<&Document>
Get a reference to a document for this key if it exists and has the correct type.
fn get_bool(&self, key: &str) -> ValueAccessResult<bool>
Get a bool value for this key if it exists and has the correct type.
fn is_null(&self, key: &str) -> bool
Returns wether this key has a null value
fn get_i32(&self, key: &str) -> ValueAccessResult<i32>
Get an i32 value for this key if it exists and has the correct type.
fn get_i64(&self, key: &str) -> ValueAccessResult<i64>
Get an i64 value for this key if it exists and has the correct type.
fn get_time_stamp(&self, key: &str) -> ValueAccessResult<i64>
Get a time stamp value for this key if it exists and has the correct type.
fn get_binary_generic(&self, key: &str) -> ValueAccessResult<&Vec<u8>>
Get a generic binary value for this key if it exists and has the correct type.
fn get_object_id(&self, key: &str) -> ValueAccessResult<&ObjectId>
Get an object id value for this key if it exists and has the correct type.
fn get_utc_datetime(&self, key: &str) -> ValueAccessResult<&DateTime<UTC>>
Get a UTC datetime value for this key if it exists and has the correct type.
fn contains_key(&self, key: &str) -> bool
Returns true if the map contains a value for the specified key.
fn keys<'a>(&'a self) -> Keys<'a>
Gets a collection of all keys in the document.
fn values<'a>(&'a self) -> Values<'a>
Gets a collection of all values in the document.
fn len(&self) -> usize
Returns the number of elements in the document.
fn is_empty(&self) -> bool
Returns true if the document contains no elements
fn insert<KT: Into<String>, BT: Into<Bson>>(&mut self,
key: KT,
val: BT)
-> Option<Bson>
key: KT,
val: BT)
-> Option<Bson>
Sets the value of the entry with the OccupiedEntry's key, and returns the entry's old value. Accepts any type that can be converted into Bson.
fn insert_bson(&mut self, key: String, val: Bson) -> Option<Bson>
Sets the value of the entry with the OccupiedEntry's key, and returns the entry's old value.
fn remove(&mut self, key: &str) -> Option<Bson>
Takes the value of the entry out of the document, and returns it.
Trait Implementations
impl Deserialize for OrderedDocument
[src]
fn deserialize<D>(deserializer: &mut D) -> Result<Self, D::Error> where D: Deserializer
Deserialize this value given this Deserializer
.
impl Debug for OrderedDocument
[src]
impl Clone for OrderedDocument
[src]
fn clone(&self) -> OrderedDocument
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
impl PartialEq for OrderedDocument
[src]
fn eq(&self, __arg_0: &OrderedDocument) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &OrderedDocument) -> bool
This method tests for !=
.
impl Display for OrderedDocument
[src]
fn fmt(&self, fmt: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter.
impl IntoIterator for OrderedDocument
[src]
type Item = (String, Bson)
The type of the elements being iterated over.
type IntoIter = OrderedDocumentIntoIterator
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
Creates an iterator from a value. Read more
impl<'a> IntoIterator for &'a OrderedDocument
[src]
type Item = (&'a String, &'a Bson)
The type of the elements being iterated over.
type IntoIter = OrderedDocumentIterator<'a>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
Creates an iterator from a value. Read more
impl FromIterator<(String, Bson)> for OrderedDocument
[src]
fn from_iter<T: IntoIterator<Item=(String, Bson)>>(iter: T) -> Self
Creates a value from an iterator. Read more
impl From<LinkedHashMap<String, Bson>> for OrderedDocument
[src]
fn from(tree: LinkedHashMap<String, Bson>) -> OrderedDocument
Performs the conversion.