pub enum Value {
Null,
String(String),
Int(i64),
Float(f64),
Bool(bool),
Array(Vec<Value>),
Object(HashMap<String, Value>),
Uuid(Uuid),
}Variants§
Null
String(String)
Int(i64)
Float(f64)
Bool(bool)
Array(Vec<Value>)
Object(HashMap<String, Value>)
Uuid(Uuid)
Implementations§
Source§impl Value
impl Value
pub fn as_str(&self) -> Option<&str>
pub fn as_bool(&self) -> Option<bool>
pub fn as_i64(&self) -> Option<i64>
pub fn as_f64(&self) -> Option<f64>
pub fn as_array(&self) -> Option<&Vec<Value>>
pub fn as_object(&self) -> Option<&HashMap<String, Value>>
pub fn as_uuid(&self) -> Option<Uuid>
pub fn as_datetime(&self) -> Option<DateTime<Utc>>
Sourcepub fn to_safe_string(&self) -> Option<String>
pub fn to_safe_string(&self) -> Option<String>
Generate a string from known value types.
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
Auto Trait Implementations§
impl Freeze for Value
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin 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