pub enum Value {
Number(i64),
Bool(bool),
Float(f64),
Nil,
String(String),
Array(Vec<Value>),
Map(IndexMap<String, Value>),
}
Expand description
Represents a data value as input or output to an expr program
Variants§
Number(i64)
Bool(bool)
Float(f64)
Nil
String(String)
Array(Vec<Value>)
Map(IndexMap<String, Value>)
Implementations§
Source§impl Value
impl Value
pub fn as_bool(&self) -> Option<bool>
pub fn as_number(&self) -> Option<i64>
pub fn as_float(&self) -> Option<f64>
pub fn as_string(&self) -> Option<&str>
pub fn as_array(&self) -> Option<&[Value]>
pub fn as_map(&self) -> Option<&IndexMap<String, Value>>
pub fn is_nil(&self) -> bool
Trait Implementations§
Source§impl<K, V> FromIterator<(K, V)> for Value
impl<K, V> FromIterator<(K, V)> 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 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