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]
impl OrderedDocument
pub fn new() -> OrderedDocument
[src]
pub fn new() -> OrderedDocument
Creates a new empty OrderedDocument.
ⓘImportant traits for OrderedDocumentIterator<'a>pub fn iter<'a>(&'a self) -> OrderedDocumentIterator<'a>
[src]
pub fn iter<'a>(&'a self) -> OrderedDocumentIterator<'a>
Gets an iterator over the entries of the map.
pub fn clear(&mut self)
[src]
pub fn clear(&mut self)
Clears the document, removing all values.
pub fn get(&self, key: &str) -> Option<&Bson>
[src]
pub fn get(&self, key: &str) -> Option<&Bson>
Returns a reference to the Bson corresponding to the key.
pub fn get_mut(&mut self, key: &str) -> Option<&mut Bson>
[src]
pub fn get_mut(&mut self, key: &str) -> Option<&mut Bson>
Gets a mutable reference to the Bson corresponding to the key
pub fn get_f64(&self, key: &str) -> ValueAccessResult<f64>
[src]
pub fn get_f64(&self, key: &str) -> ValueAccessResult<f64>
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]
pub fn get_str(&self, key: &str) -> ValueAccessResult<&str>
Get a string slice this key if it exists and has the correct type.
pub fn get_array(&self, key: &str) -> ValueAccessResult<&Array>
[src]
pub 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.
pub fn get_document(&self, key: &str) -> ValueAccessResult<&Document>
[src]
pub 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.
pub fn get_bool(&self, key: &str) -> ValueAccessResult<bool>
[src]
pub fn get_bool(&self, key: &str) -> ValueAccessResult<bool>
Get a bool value for this key if it exists and has the correct type.
pub fn is_null(&self, key: &str) -> bool
[src]
pub fn is_null(&self, key: &str) -> bool
Returns wether this key has a null value
pub fn get_i32(&self, key: &str) -> ValueAccessResult<i32>
[src]
pub fn get_i32(&self, key: &str) -> ValueAccessResult<i32>
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]
pub fn get_i64(&self, key: &str) -> ValueAccessResult<i64>
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]
pub 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.
pub fn get_binary_generic(&self, key: &str) -> ValueAccessResult<&Vec<u8>>
[src]
pub 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.
pub fn get_object_id(&self, key: &str) -> ValueAccessResult<&ObjectId>
[src]
pub 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.
pub fn get_utc_datetime(&self, key: &str) -> ValueAccessResult<&DateTime<Utc>>
[src]
pub 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.
pub fn contains_key(&self, key: &str) -> bool
[src]
pub fn contains_key(&self, key: &str) -> bool
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]
pub fn keys<'a>(&'a self) -> Keys<'a>
Gets a collection of all keys in the document.
ⓘImportant traits for Values<'a>pub fn values<'a>(&'a self) -> Values<'a>
[src]
pub fn values<'a>(&'a self) -> Values<'a>
Gets a collection of all values in the document.
pub fn len(&self) -> usize
[src]
pub fn len(&self) -> usize
Returns the number of elements in the document.
pub fn is_empty(&self) -> bool
[src]
pub fn is_empty(&self) -> bool
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]
pub fn insert<KT: Into<String>, BT: Into<Bson>>(
&mut self,
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.
pub fn insert_bson(&mut self, key: String, val: Bson) -> Option<Bson>
[src]
pub 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.
pub fn remove(&mut self, key: &str) -> Option<Bson>
[src]
pub fn remove(&mut self, key: &str) -> Option<Bson>
Takes the value of the entry out of the document, and returns it.
pub fn entry(&mut self, k: String) -> Entry
[src]
pub fn entry(&mut self, k: String) -> Entry
Trait Implementations
impl<'de> Deserialize<'de> for OrderedDocument
[src]
impl<'de> Deserialize<'de> for OrderedDocument
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
[src]
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
Deserialize this value given this Deserializer
.
impl Clone for OrderedDocument
[src]
impl Clone for OrderedDocument
fn clone(&self) -> OrderedDocument
[src]
fn clone(&self) -> OrderedDocument
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl PartialEq for OrderedDocument
[src]
impl PartialEq for OrderedDocument
fn eq(&self, other: &OrderedDocument) -> bool
[src]
fn eq(&self, other: &OrderedDocument) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &OrderedDocument) -> bool
[src]
fn ne(&self, other: &OrderedDocument) -> bool
This method tests for !=
.
impl Default for OrderedDocument
[src]
impl Default for OrderedDocument
impl Display for OrderedDocument
[src]
impl Display for OrderedDocument
fn fmt(&self, fmt: &mut Formatter) -> Result
[src]
fn fmt(&self, fmt: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Debug for OrderedDocument
[src]
impl Debug for OrderedDocument
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl IntoIterator for OrderedDocument
[src]
impl IntoIterator for OrderedDocument
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
[src]
fn into_iter(self) -> Self::IntoIter
Creates an iterator from a value. Read more
impl<'a> IntoIterator for &'a OrderedDocument
[src]
impl<'a> IntoIterator for &'a OrderedDocument
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
[src]
fn into_iter(self) -> Self::IntoIter
Creates an iterator from a value. Read more
impl FromIterator<(String, Bson)> for OrderedDocument
[src]
impl FromIterator<(String, Bson)> for OrderedDocument
fn from_iter<T: IntoIterator<Item = (String, Bson)>>(iter: T) -> Self
[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]
impl From<LinkedHashMap<String, Bson>> for OrderedDocument
fn from(tree: LinkedHashMap<String, Bson>) -> OrderedDocument
[src]
fn from(tree: LinkedHashMap<String, Bson>) -> OrderedDocument
Performs the conversion.
Auto Trait Implementations
impl Send for OrderedDocument
impl Send for OrderedDocument
impl Sync for OrderedDocument
impl Sync for OrderedDocument