pub enum Expr {
Literal(String),
Number(f64),
Unit {
value: f64,
unit: String,
},
Color(String),
Variable(String),
Binary {
op: BinaryOp,
left: Box<Expr>,
right: Box<Expr>,
},
FunctionCall {
name: String,
args: Vec<Expr>,
},
Object(Vec<(String, Expr)>),
Array(Vec<Expr>),
}Expand description
Expressions that can be evaluated
Variants§
Literal(String)
String literal: “hello”
Number(f64)
Number: 42, 3.14
Unit
Number with unit: 16px, 2em, 50%
Color(String)
Color: #fff, #3498db
Variable(String)
Variable reference: primary-color
Binary
Binary operation: left op right
FunctionCall
Function call: spacing(2)
Object(Vec<(String, Expr)>)
Object/Map: { key: value, … }
Array(Vec<Expr>)
Array: [expr, expr, …]
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Expr
impl<'de> Deserialize<'de> for Expr
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 Expr
Auto Trait Implementations§
impl Freeze for Expr
impl RefUnwindSafe for Expr
impl Send for Expr
impl Sync for Expr
impl Unpin for Expr
impl UnwindSafe for Expr
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