Enum bson::Bson [] [src]

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

Possible BSON value types.

Variants

FloatingPoint(f64)String(String)Array(Array)Document(Document)Boolean(bool)NullRegExp(StringString)JavaScriptCode(String)JavaScriptCodeWithScope(StringDocument)I32(i32)I64(i64)TimeStamp(i64)Binary(BinarySubtypeVec<u8>)ObjectId(ObjectId)UtcDatetime(DateTime<UTC>)

Methods

impl Bson
[src]

fn element_type(&self) -> ElementType

Get the ElementType of this value.

fn to_json(&self) -> Json

Convert this value to the best approximate Json.

fn from_json(j: &Json) -> Bson

Create a Bson from a Json.

Trait Implementations

impl PartialEq for Bson
[src]

fn eq(&self, __arg_0: &Bson) -> bool

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

fn ne(&self, __arg_0: &Bson) -> bool

This method tests for !=.

impl Clone for Bson
[src]

fn clone(&self) -> Bson

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 Debug for Bson
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.

impl Display for Bson
[src]

fn fmt(&self, fmt: &mut Formatter) -> Result<()Error>

Formats the value using the given formatter.

impl From<f32> for Bson
[src]

fn from(a: f32) -> Bson

Performs the conversion.

impl From<f64> for Bson
[src]

fn from(a: f64) -> Bson

Performs the conversion.

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

fn from(s: &str) -> Bson

Performs the conversion.

impl From<String> for Bson
[src]

fn from(a: String) -> Bson

Performs the conversion.

impl From<Array> for Bson
[src]

fn from(a: Array) -> Bson

Performs the conversion.

impl From<Document> for Bson
[src]

fn from(a: Document) -> Bson

Performs the conversion.

impl From<bool> for Bson
[src]

fn from(a: bool) -> Bson

Performs the conversion.

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

fn from(a: (String, String)) -> Bson

Performs the conversion.

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

fn from(a: (String, Document)) -> Bson

Performs the conversion.

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

fn from(a: (BinarySubtype, Vec<u8>)) -> Bson

Performs the conversion.

impl From<i32> for Bson
[src]

fn from(a: i32) -> Bson

Performs the conversion.

impl From<i64> for Bson
[src]

fn from(a: i64) -> Bson

Performs the conversion.

impl From<u32> for Bson
[src]

fn from(a: u32) -> Bson

Performs the conversion.

impl From<u64> for Bson
[src]

fn from(a: u64) -> Bson

Performs the conversion.

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

fn from(a: [u8; 12]) -> Bson

Performs the conversion.

impl From<ObjectId> for Bson
[src]

fn from(a: ObjectId) -> Bson

Performs the conversion.

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

fn from(a: DateTime<UTC>) -> Bson

Performs the conversion.