#[repr(u8)]
pub enum ElementType {
Show 21 variants Double, String, EmbeddedDocument, Array, Binary, Undefined, ObjectId, Boolean, DateTime, Null, RegularExpression, DbPointer, JavaScriptCode, Symbol, JavaScriptCodeWithScope, Int32, Timestamp, Int64, Decimal128, MaxKey, MinKey,
}
Expand description

All available BSON element types.

Not all element types are representable by the Bson type.

Variants

Double

64-bit binary floating point

String

UTF-8 string

EmbeddedDocument

Embedded document

Array

Array

Binary

Binary data

Undefined

Deprecated. Undefined (value)

ObjectId

Boolean

Bool value

DateTime

UTC datetime

Null

Null value

RegularExpression

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.

DbPointer

Deprecated.

JavaScriptCode

JavaScript code

Symbol

Deprecated.

JavaScriptCodeWithScope

JavaScript code w/ scope

Int32

32-bit integer

Timestamp

Timestamp

Int64

64-bit integer

Decimal128

MaxKey

MinKey

Implementations

Attempt to convert from a u8.

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

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

This method tests for !=.

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

Compare self to key and return true if they are equal.

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.