pub enum Value {
Boolean(bool),
Integer(i64),
Decimal(f64),
String(String),
List(Vec<Value>),
Map(IndexMap<String, Value>),
}Expand description
All possible value types
Variants§
Boolean(bool)
Integer(i64)
Decimal(f64)
String(String)
List(Vec<Value>)
Map(IndexMap<String, Value>)
Implementations§
Source§impl Value
impl Value
pub fn as_boolean(&self) -> Option<bool>
pub fn as_integer(&self) -> Option<i64>
pub fn as_decimal(&self) -> Option<f64>
pub fn as_string(&self) -> Option<&String>
pub fn as_str(&self) -> Option<&str>
pub fn to_string(&self) -> Option<String>
pub fn kind(&self) -> ValueKind
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
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