pub enum RawBson {
Show 21 variants Double(f64), String(String), Array(RawArrayBuf), Document(RawDocumentBuf), Boolean(bool), Null, RegularExpression(Regex), JavaScriptCode(String), JavaScriptCodeWithScope(RawJavaScriptCodeWithScope), Int32(i32), Int64(i64), Timestamp(Timestamp), Binary(Binary), ObjectId(ObjectId), DateTime(DateTime), Symbol(String), Decimal128(Decimal128), Undefined, MaxKey, MinKey, DbPointer(DbPointer),
}
Expand description

A BSON value backed by owned raw BSON bytes.

Variants

Double(f64)

64-bit binary floating point

String(String)

UTF-8 string

Array(RawArrayBuf)

Array

Document(RawDocumentBuf)

Embedded document

Boolean(bool)

Boolean value

Null

Null value

RegularExpression(Regex)

Regular expression

JavaScriptCode(String)

JavaScript code

JavaScriptCodeWithScope(RawJavaScriptCodeWithScope)

JavaScript code w/ scope

Int32(i32)

32-bit signed integer

Int64(i64)

64-bit signed integer

Timestamp(Timestamp)

Timestamp

Binary(Binary)

Binary data

ObjectId(ObjectId)

DateTime(DateTime)

UTC datetime

Symbol(String)

Symbol (Deprecated)

Decimal128(Decimal128)

Undefined

Undefined value (Deprecated)

MaxKey

Max key

MinKey

Min key

DbPointer(DbPointer)

DBPointer (Deprecated)

Implementations

Get the ElementType of this value.

Gets the wrapped f64 value or returns None if the value isn’t a BSON double.

Gets a reference to the String that’s wrapped or returns None if the wrapped value isn’t a BSON String.

Gets a reference to the RawArrayBuf that’s wrapped or returns None if the wrapped value isn’t a BSON array.

Gets a mutable reference to the RawArrayBuf that’s wrapped or returns None if the wrapped value isn’t a BSON array.

Gets a reference to the RawDocumentBuf that’s wrapped or returns None if the wrapped value isn’t a BSON document.

Gets a mutable reference to the RawDocumentBuf that’s wrapped or returns None if the wrapped value isn’t a BSON document.

Gets the wrapped bool value or returns None if the wrapped value isn’t a BSON boolean.

Gets the wrapped i32 value or returns None if the wrapped value isn’t a BSON Int32.

Gets the wrapped i64 value or returns None if the wrapped value isn’t a BSON Int64.

Gets the wrapped crate::oid::ObjectId value or returns None if the wrapped value isn’t a BSON ObjectID.

Gets a reference to the Binary that’s wrapped or returns None if the wrapped value isn’t a BSON binary.

Gets a reference to the Regex that’s wrapped or returns None if the wrapped value isn’t a BSON regular expression.

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

Gets a reference to the symbol that’s wrapped or returns None if the wrapped value isn’t a BSON Symbol.

Gets the wrapped crate::Timestamp value or returns None if the wrapped value isn’t a BSON datetime.

Returns Some(()) if this value is null, otherwise returns None.

Gets a reference to the crate::DbPointer that’s wrapped or returns None if the wrapped value isn’t a BSON DbPointer.

Gets a reference to the code that’s wrapped or returns None if the wrapped value isn’t a BSON JavaScript code.

Gets a reference to the RawJavaScriptCodeWithScope that’s wrapped or returns None if the wrapped value isn’t a BSON JavaScript code with scope value.

Gets a RawBsonRef value referencing this owned raw BSON value.

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

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

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

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

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.