pub enum RawBson<'a> {
}
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
sourceimpl<'a> RawBson<'a>
impl<'a> RawBson<'a>
sourcepub fn element_type(&self) -> ElementType
pub fn element_type(&self) -> ElementType
Get the ElementType
of this value.
sourcepub fn as_f64(self) -> Option<f64>
pub fn as_f64(self) -> Option<f64>
Gets the f64
that’s referenced or returns None
if the referenced value isn’t a BSON
double.
sourcepub fn as_str(self) -> Option<&'a str>
pub fn as_str(self) -> Option<&'a str>
Gets the &str
that’s referenced or returns None
if the referenced value isn’t a BSON
String.
sourcepub fn as_array(self) -> Option<&'a RawArray>
pub fn as_array(self) -> Option<&'a RawArray>
Gets the RawArray
that’s referenced or returns None
if the referenced value
isn’t a BSON array.
sourcepub fn as_document(self) -> Option<&'a RawDocument>
pub fn as_document(self) -> Option<&'a RawDocument>
Gets the RawDocument
that’s referenced or returns None
if the referenced value
isn’t a BSON document.
sourcepub fn as_bool(self) -> Option<bool>
pub fn as_bool(self) -> Option<bool>
Gets the bool
that’s referenced or returns None
if the referenced value isn’t a BSON
boolean.
sourcepub fn as_i32(self) -> Option<i32>
pub fn as_i32(self) -> Option<i32>
Gets the i32
that’s referenced or returns None
if the referenced value isn’t a BSON
Int32.
sourcepub fn as_i64(self) -> Option<i64>
pub fn as_i64(self) -> Option<i64>
Gets the i64
that’s referenced or returns None
if the referenced value isn’t a BSON
Int64.
sourcepub fn as_binary(self) -> Option<RawBinary<'a>>
pub fn as_binary(self) -> Option<RawBinary<'a>>
Gets the RawBinary
that’s referenced or returns None
if the referenced value isn’t a
BSON binary.
sourcepub fn as_datetime(self) -> Option<DateTime>
pub fn as_datetime(self) -> Option<DateTime>
Gets the crate::DateTime
that’s referenced or returns None
if the referenced value
isn’t a BSON datetime.
sourcepub fn as_timestamp(self) -> Option<Timestamp>
pub fn as_timestamp(self) -> Option<Timestamp>
Gets the crate::Timestamp
that’s referenced or returns None
if the referenced value
isn’t a BSON timestamp.
Trait Implementations
sourceimpl<'de: 'a, 'a> Deserialize<'de> for RawBson<'a>
impl<'de: 'a, 'a> Deserialize<'de> for RawBson<'a>
sourcefn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl<'a> Copy for RawBson<'a>
impl<'a> StructuralPartialEq for RawBson<'a>
Auto Trait Implementations
impl<'a> RefUnwindSafe for RawBson<'a>
impl<'a> Send for RawBson<'a>
impl<'a> Sync for RawBson<'a>
impl<'a> Unpin for RawBson<'a>
impl<'a> UnwindSafe for RawBson<'a>
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