pub enum Value {
}Expand description
Represents a data value as input or output to an expr program
Variants§
Integer(i64)
Bool(bool)
Float(f64)
Nil
String(String)
DateTime(DateTimeValue)
Duration(i64)
Timezone(TimezoneValue)
Month(u32)
Weekday(u32)
Array(Vec<Value>)
Bytes(Vec<u8>)
Map(IndexMap<String, Value>)
KeyedMap(Vec<(Value, Value)>)
A map whose keys are arbitrary expr values.
Implementations§
Source§impl Value
impl Value
pub fn as_bool(&self) -> Option<bool>
pub fn as_integer(&self) -> Option<i64>
pub fn as_float(&self) -> Option<f64>
pub fn as_string(&self) -> Option<&str>
pub fn as_bytes(&self) -> Option<&[u8]>
pub fn as_datetime(&self) -> Option<&DateTime<FixedOffset>>
pub fn as_duration(&self) -> Option<i64>
pub fn as_array(&self) -> Option<&[Value]>
pub fn as_map(&self) -> Option<&IndexMap<String, Value>>
pub fn as_keyed_map(&self) -> Option<&[(Value, 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 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