pub enum Value {
Int(i64),
Float(f64),
Str(String),
Bool(bool),
Bytes(Vec<u8>),
None,
List(Vec<Value>),
Dict(HashMap<String, Value>),
Optional(Option<Box<Value>>),
Promise(PromiseState),
Result(Result<Box<Value>, Box<Value>>),
Function {
params: Vec<String>,
body: Vec<u8>,
},
}Expand description
Runtime values in Glyph
Variants§
Int(i64)
Integer value
Float(f64)
Floating point value
Str(String)
String value
Bool(bool)
Boolean value
Bytes(Vec<u8>)
Byte array
None
None/unit value
List(Vec<Value>)
List of values
Dict(HashMap<String, Value>)
Dictionary of string keys to values
Optional(Option<Box<Value>>)
Optional value
Promise(PromiseState)
Promise (async computation)
Result(Result<Box<Value>, Box<Value>>)
Result type
Function
Function (not directly serializable)
Implementations§
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
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