pub enum Value {
}Expand description
A generic wrapper enum to hold any DBMS value.
Variants§
Blob(Blob)
Boolean(Boolean)
Date(Date)
DateTime(DateTime)
Decimal(Decimal)
Int8(Int8)
Int16(Int16)
Int32(Int32)
Int64(Int64)
Json(Json)
Null
Text(Text)
Uint8(Uint8)
Uint16(Uint16)
Uint32(Uint32)
Uint64(Uint64)
Uuid(Uuid)
Custom(CustomValue)
Implementations§
Source§impl Value
impl Value
Sourcepub fn as_boolean(&self) -> Option<&Boolean>
pub fn as_boolean(&self) -> Option<&Boolean>
Attempts to extract a reference to the inner value if it matches the variant.
Source§impl Value
impl Value
Sourcepub fn as_datetime(&self) -> Option<&DateTime>
pub fn as_datetime(&self) -> Option<&DateTime>
Attempts to extract a reference to the inner value if it matches the variant.
Source§impl Value
impl Value
Sourcepub fn as_decimal(&self) -> Option<&Decimal>
pub fn as_decimal(&self) -> Option<&Decimal>
Attempts to extract a reference to the inner value if it matches the variant.
Source§impl Value
impl Value
Sourcepub fn is_null(&self) -> bool
pub fn is_null(&self) -> bool
Checks if the value is Value::Null.
Sourcepub fn as_custom(&self) -> Option<&CustomValue>
pub fn as_custom(&self) -> Option<&CustomValue>
Returns reference to the inner [CustomValue] if this is a Custom variant.
Sourcepub fn as_custom_type<T: CustomDataType>(&self) -> Option<T>
pub fn as_custom_type<T: CustomDataType>(&self) -> Option<T>
Attempts to decode a Custom variant into a concrete CustomDataType.
Returns None if this is not a Custom variant, the type tag doesn’t
match, or decoding fails.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Value
impl<'de> Deserialize<'de> for Value
Source§fn 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
Source§impl Ord for Value
impl Ord for Value
Source§impl PartialOrd for Value
impl PartialOrd for Value
impl Eq for Value
impl StructuralPartialEq for Value
Auto Trait Implementations§
impl Freeze for Value
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnsafeUnpin for Value
impl UnwindSafe for Value
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more