pub enum Literal {
Bool(bool),
Int(i64),
Float(f64),
Str(String),
Bytes(Vec<u8>),
Null,
Record(Vec<(Arc<str>, Self)>),
List(Vec<Self>),
Closure {
param: Arc<str>,
body: Box<Expr>,
env: Vec<(Arc<str>, Self)>,
},
}Expand description
A literal value in the expression language.
This is the result type of expression evaluation and the leaf node type for literal expressions. Kept minimal — just the primitives needed for schema transforms.
Variants§
Bool(bool)
Boolean value.
Int(i64)
64-bit signed integer.
Float(f64)
64-bit IEEE 754 float.
Str(String)
UTF-8 string.
Bytes(Vec<u8>)
Raw bytes.
Null
Null / absent value.
Record(Vec<(Arc<str>, Self)>)
A record (ordered map of fields to values).
List(Vec<Self>)
A list of values.
Closure
A closure: a lambda expression captured with its environment.
Closures are first-class values produced by evaluating a Lam expression.
They capture the parameter name, body, and the environment at the point
of creation, enabling proper lexical scoping.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Literal
impl<'de> Deserialize<'de> for Literal
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 Eq for Literal
Auto Trait Implementations§
impl Freeze for Literal
impl RefUnwindSafe for Literal
impl Send for Literal
impl Sync for Literal
impl Unpin for Literal
impl UnsafeUnpin for Literal
impl UnwindSafe for Literal
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