[][src]Struct bson::ordered::OrderedDocument

pub struct OrderedDocument { /* fields omitted */ }

A BSON document represented as an associative HashMap with insertion ordering.

Methods

impl OrderedDocument[src]

pub fn new() -> OrderedDocument[src]

Creates a new empty OrderedDocument.

Important traits for OrderedDocumentIterator<'a>
pub fn iter<'a>(&'a self) -> OrderedDocumentIterator<'a>[src]

Gets an iterator over the entries of the map.

pub fn clear(&mut self)[src]

Clears the document, removing all values.

pub fn get(&self, key: &str) -> Option<&Bson>[src]

Returns a reference to the Bson corresponding to the key.

pub fn get_mut(&mut self, key: &str) -> Option<&mut Bson>[src]

Gets a mutable reference to the Bson corresponding to the key

pub fn get_f64(&self, key: &str) -> ValueAccessResult<f64>[src]

Get a floating point value for this key if it exists and has the correct type.

pub fn get_str(&self, key: &str) -> ValueAccessResult<&str>[src]

Get a string slice this key if it exists and has the correct type.

pub fn get_array(&self, key: &str) -> ValueAccessResult<&Array>[src]

Get a reference to an array for this key if it exists and has the correct type.

pub fn get_document(&self, key: &str) -> ValueAccessResult<&Document>[src]

Get a reference to a document for this key if it exists and has the correct type.

pub fn get_bool(&self, key: &str) -> ValueAccessResult<bool>[src]

Get a bool value for this key if it exists and has the correct type.

pub fn is_null(&self, key: &str) -> bool[src]

Returns wether this key has a null value

pub fn get_i32(&self, key: &str) -> ValueAccessResult<i32>[src]

Get an i32 value for this key if it exists and has the correct type.

pub fn get_i64(&self, key: &str) -> ValueAccessResult<i64>[src]

Get an i64 value for this key if it exists and has the correct type.

pub fn get_time_stamp(&self, key: &str) -> ValueAccessResult<i64>[src]

Get a time stamp value for this key if it exists and has the correct type.

pub fn get_binary_generic(&self, key: &str) -> ValueAccessResult<&Vec<u8>>[src]

Get a generic binary value for this key if it exists and has the correct type.

pub fn get_object_id(&self, key: &str) -> ValueAccessResult<&ObjectId>[src]

Get an object id value for this key if it exists and has the correct type.

pub fn get_utc_datetime(&self, key: &str) -> ValueAccessResult<&DateTime<Utc>>[src]

Get a UTC datetime value for this key if it exists and has the correct type.

pub fn contains_key(&self, key: &str) -> bool[src]

Returns true if the map contains a value for the specified key.

Important traits for Keys<'a>
pub fn keys<'a>(&'a self) -> Keys<'a>[src]

Gets a collection of all keys in the document.

Important traits for Values<'a>
pub fn values<'a>(&'a self) -> Values<'a>[src]

Gets a collection of all values in the document.

pub fn len(&self) -> usize[src]

Returns the number of elements in the document.

pub fn is_empty(&self) -> bool[src]

Returns true if the document contains no elements

pub fn insert<KT: Into<String>, BT: Into<Bson>>(
    &mut self,
    key: KT,
    val: BT
) -> Option<Bson>
[src]

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.

pub fn insert_bson(&mut self, key: String, val: Bson) -> Option<Bson>[src]

Sets the value of the entry with the OccupiedEntry's key, and returns the entry's old value.

pub fn remove(&mut self, key: &str) -> Option<Bson>[src]

Takes the value of the entry out of the document, and returns it.

pub fn entry(&mut self, k: String) -> Entry[src]

Trait Implementations

impl PartialEq<OrderedDocument> for OrderedDocument[src]

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?

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?

impl Default for OrderedDocument[src]

impl Clone for OrderedDocument[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl From<OrderedDocument> for Bson[src]

impl From<LinkedHashMap<String, Bson, RandomState>> for OrderedDocument[src]

impl Debug for OrderedDocument[src]

impl Display for OrderedDocument[src]

impl FromIterator<(String, Bson)> for OrderedDocument[src]

impl<'de> Deserialize<'de> for OrderedDocument[src]

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
    D: Deserializer<'de>, 
[src]

Deserialize this value given this Deserializer.

Auto Trait Implementations

impl Send for OrderedDocument

impl Sync for OrderedDocument

Blanket Implementations

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Err = <U as TryFrom<T>>::Err