[][src]Enum mongodb::Bson

pub enum Bson {
    FloatingPoint(f64),
    String(String),
    Array(Vec<Bson>),
    Document(OrderedDocument),
    Boolean(bool),
    Null,
    RegExp(StringString),
    JavaScriptCode(String),
    JavaScriptCodeWithScope(StringOrderedDocument),
    I32(i32),
    I64(i64),
    TimeStamp(i64),
    Binary(BinarySubtypeVec<u8>),
    ObjectId(ObjectId),
    UtcDatetime(DateTime<Utc>),
    Symbol(String),
}

Possible BSON value types.

Variants

64-bit binary floating point

UTF-8 string

Array

Embedded document

Boolean value

Null value

Regular expression - The first cstring is the regex pattern, the second is the regex options string. Options are identified by characters, which must be stored in alphabetical order. Valid options are 'i' for case insensitive matching, 'm' for multiline matching, 'x' for verbose mode, 'l' to make \w, \W, etc. locale dependent, 's' for dotall mode ('.' matches everything), and 'u' to make \w, \W, etc. match unicode.

JavaScript code

JavaScript code w/ scope

32-bit integer

64-bit integer

Timestamp

Binary data

UTC datetime

Symbol (Deprecated)

Methods

impl Bson
[src]

Get the ElementType of this value.

Deprecated since 0.5.1

: use bson.clone().into() instead

Clones the bson and returns the representative serde_json Value. The json will be in extended JSON format.

Deprecated since 0.5.1

: use bson.into() instead

Consumes the bson and returns the representative serde_json Value. The json will be in extended JSON format.

Deprecated since 0.5.1

: use json.into() instead

Consumes the serde_json Value and returns the representative bson. The json should be in extended JSON format.

impl Bson
[src]

Value helpers

If Bson is FloatingPoint, return its value. Returns None otherwise

If Bson is String, return its value. Returns None otherwise

If Bson is Array, return its value. Returns None otherwise

If Bson is Document, return its value. Returns None otherwise

If Bson is Boolean, return its value. Returns None otherwise

If Bson is I32, return its value. Returns None otherwise

If Bson is I64, return its value. Returns None otherwise

If Bson is Objectid, return its value. Returns None otherwise

If Bson is UtcDateTime, return its value. Returns None otherwise

If Bson is Symbol, return its value. Returns None otherwise

If Bson is TimeStamp, return its value. Returns None otherwise

If Bson is Null, return its value. Returns None otherwise

Trait Implementations

impl Clone for Bson
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Display for Bson
[src]

Formats the value using the given formatter. Read more

impl Default for Bson
[src]

Returns the "default value" for a type. Read more

impl Serialize for Bson
[src]

Serialize this value into the given Serde serializer. Read more

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

Deserialize this value from the given Serde deserializer. Read more

impl Debug for Bson
[src]

Formats the value using the given formatter. Read more

impl From<i64> for Bson
[src]

Performs the conversion.

impl From<ObjectId> for Bson
[src]

Performs the conversion.

impl From<f32> for Bson
[src]

Performs the conversion.

impl From<u32> for Bson
[src]

Performs the conversion.

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

Performs the conversion.

impl From<Vec<Bson>> for Bson
[src]

Performs the conversion.

impl From<i32> for Bson
[src]

Performs the conversion.

impl From<(BinarySubtype, Vec<u8>)> for Bson
[src]

Performs the conversion.

impl<'a> From<&'a str> for Bson
[src]

Performs the conversion.

impl From<OrderedDocument> for Bson
[src]

Performs the conversion.

impl From<bool> for Bson
[src]

Performs the conversion.

impl From<u64> for Bson
[src]

Performs the conversion.

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

Performs the conversion.

impl From<String> for Bson
[src]

Performs the conversion.

impl From<f64> for Bson
[src]

Performs the conversion.

impl From<[u8; 12]> for Bson
[src]

Performs the conversion.

impl From<Value> for Bson
[src]

Performs the conversion.

impl<'a> From<&'a String> for Bson
[src]

Performs the conversion.

impl From<DateTime<Utc>> for Bson
[src]

Performs the conversion.

impl PartialEq<Bson> for Bson
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl From<Role> for Bson
[src]

Performs the conversion.

Auto Trait Implementations

impl Send for Bson

impl Sync for Bson

Blanket Implementations

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

Creates owned data from borrowed data, usually by cloning. Read more

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

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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

Converts the given value to a String. Read more

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

Performs the conversion.

impl<T> From for T
[src]

Performs the conversion.

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

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

The type returned in the event of a conversion error.

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

Performs the conversion.

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

Immutably borrows from an owned value. Read more

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

Mutably borrows from an owned value. Read more

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

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

The type returned in the event of a conversion error.

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

Performs the conversion.

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

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

this method will likely be replaced by an associated static

Gets the TypeId of self. Read more

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

impl<T, U> TryInto for T where
    U: TryFrom<T>, 

impl<T> Same for T

Should always be Self