Enum bson::spec::ElementType
source · [−]#[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
sourceimpl ElementType
impl ElementType
sourcepub fn from(tag: u8) -> Option<ElementType>
pub fn from(tag: u8) -> Option<ElementType>
Attempt to convert from a u8
.
Trait Implementations
sourceimpl Clone for ElementType
impl Clone for ElementType
sourcefn clone(&self) -> ElementType
fn clone(&self) -> ElementType
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for ElementType
impl Debug for ElementType
sourceimpl PartialEq<ElementType> for ElementType
impl PartialEq<ElementType> for ElementType
impl Copy for ElementType
impl Eq for ElementType
impl StructuralEq for ElementType
impl StructuralPartialEq for ElementType
Auto Trait Implementations
impl RefUnwindSafe for ElementType
impl Send for ElementType
impl Sync for ElementType
impl Unpin for ElementType
impl UnwindSafe for ElementType
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.