pub enum RawBson<'a> {
Show 14 variants Double(f64), String(&'a str), Array(&'a RawArray), Document(&'a RawDocument), Boolean(bool), Null, Int32(i32), Int64(i64), UInt32(u32), UInt64(u64), Timestamp(Timestamp), Binary(RawBinary<'a>), DateTime(DateTime), Decimal128(Decimal128),
}
Expand description

A BSON value referencing raw bytes stored elsewhere.

Variants

Double(f64)

64-bit binary floating point

String(&'a str)

UTF-8 string

Array(&'a RawArray)

Array

Document(&'a RawDocument)

Embedded document

Boolean(bool)

Boolean value

Null

Null value

Int32(i32)

32-bit signed integer

Int64(i64)

64-bit signed integer

UInt32(u32)

32-bit signed integer

UInt64(u64)

64-bit signed integer

Timestamp(Timestamp)

Timestamp

Binary(RawBinary<'a>)

Binary data

DateTime(DateTime)

UTC datetime

Decimal128(Decimal128)

Implementations

Get the ElementType of this value.

Gets the f64 that’s referenced or returns None if the referenced value isn’t a BSON double.

Gets the &str that’s referenced or returns None if the referenced value isn’t a BSON String.

Gets the RawArray that’s referenced or returns None if the referenced value isn’t a BSON array.

Gets the RawDocument that’s referenced or returns None if the referenced value isn’t a BSON document.

Gets the bool that’s referenced or returns None if the referenced value isn’t a BSON boolean.

Gets the i32 that’s referenced or returns None if the referenced value isn’t a BSON Int32.

Gets the i64 that’s referenced or returns None if the referenced value isn’t a BSON Int64.

Gets the RawBinary that’s referenced or returns None if the referenced value isn’t a BSON binary.

Gets the crate::DateTime that’s referenced or returns None if the referenced value isn’t a BSON datetime.

Gets the crate::Timestamp that’s referenced or returns None if the referenced value isn’t a BSON timestamp.

Gets the null value that’s referenced or returns None if the referenced value isn’t a BSON null.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

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

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

The type returned in the event of a conversion error.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

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

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.