Enum mon::bson::bson::Bson
[−]
[src]
pub enum Bson {
Double(f64),
String(String),
Array(Array),
Document(Document),
Boolean(bool),
Null,
RegExp(String, String),
JavaScriptCode(String),
JavaScriptCodeWithScope(String, Document),
Int32(i32),
Int64(i64),
TimeStamp(i64),
Binary(BinarySubtype, Vec<u8>),
ObjectId(ObjectId),
UTCDatetime(DateTime<Utc>),
Symbol(String),
}Variants
Double(f64)String(String)Array(Array)Document(Document)Boolean(bool)NullRegExp(String, String)JavaScriptCode(String)JavaScriptCodeWithScope(String, Document)Int32(i32)Int64(i64)TimeStamp(i64)Binary(BinarySubtype, Vec<u8>)ObjectId(ObjectId)UTCDatetime(DateTime<Utc>)Symbol(String)Methods
impl Bson[src]
fn element_type(&self) -> ElementType
fn as_f64(&self) -> Option<f64>
If Bson is Double, return its value. Returns None otherwise
fn as_str(&self) -> Option<&str>
If Bson is String, return its value. Returns None otherwise
fn as_array(&self) -> Option<&Array>
If Bson is Array, return its value. Returns None otherwise
fn as_document(&self) -> Option<&Document>
If Bson is Document, return its value. Returns None otherwise
fn as_bool(&self) -> Option<bool>
If Bson is Boolean, return its value. Returns None otherwise
fn as_i32(&self) -> Option<i32>
If Bson is I32, return its value. Returns None otherwise
fn as_i64(&self) -> Option<i64>
If Bson is I64, return its value. Returns None otherwise
fn as_object_id(&self) -> Option<&ObjectId>
If Bson is Objectid, return its value. Returns None otherwise
fn as_utc_date_time(&self) -> Option<&DateTime<Utc>>
If Bson is UtcDateTime, return its value. Returns None otherwise
fn as_symbol(&self) -> Option<&str>
If Bson is Symbol, return its value. Returns None otherwise
fn as_timestamp(&self) -> Option<i64>
If Bson is TimeStamp, return its value. Returns None otherwise
fn as_null(&self) -> Option<()>
If Bson is Null, return its value. Returns None otherwise
fn to_json(&self) -> Value
fn into_json(self) -> Value
fn from_json(val: Value) -> Bson
fn to_extended_document(&self) -> Document
Trait Implementations
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 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 Debug for Bson[src]
impl Display for Bson[src]
impl From<f32> for Bson[src]
impl From<f64> for Bson[src]
impl<'a> From<&'a str> for Bson[src]
impl From<String> for Bson[src]
impl<'a> From<&'a String> for Bson[src]
impl From<Array> for Bson[src]
impl From<Document> for Bson[src]
impl From<bool> for Bson[src]
impl From<(String, String)> for Bson[src]
impl From<(String, Document)> for Bson[src]
impl From<(BinarySubtype, Vec<u8>)> for Bson[src]
impl From<i32> for Bson[src]
impl From<i64> for Bson[src]
impl From<u32> for Bson[src]
impl From<u64> for Bson[src]
impl From<[u8; 12]> for Bson[src]
impl From<ObjectId> for Bson[src]
impl From<DateTime<Utc>> for Bson[src]
impl From<Value> for Bson[src]
impl Into<Value> for Bson[src]
impl Serialize for Bson[src]
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where
S: Serializer,
S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl<'de> Deserialize<'de> for Bson[src]
fn deserialize<D>(deserializer: D) -> Result<Bson, D::Error> where
D: Deserializer<'de>,
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more