pub enum Expr {
Num(u16),
Var(NodeId),
Add(Id, Id),
Sub(Id, Id),
Max(Id, Id),
Min(Id, Id),
Div(Id, Id),
Mul(Id, Id),
Clamp {
min: Id,
max: Id,
val: Id,
},
HFlex(Vec<Id>),
VFlex(Vec<Id>),
Fill(Id),
}Expand description
A layout expression in the e-graph.
Expressions form an AST that encodes layout constraint arithmetic
and container relationships. Each expression node is identified by
an Id in the e-graph.
Variants§
Num(u16)
A concrete pixel/cell value.
Var(NodeId)
A reference to a widget’s size.
Add(Id, Id)
Addition: a + b.
Sub(Id, Id)
Subtraction: a - b.
Max(Id, Id)
Maximum: max(a, b).
Min(Id, Id)
Minimum: min(a, b).
Div(Id, Id)
Division: a / b.
Mul(Id, Id)
Multiplication: a * b.
Clamp
Clamp value between min and max.
HFlex(Vec<Id>)
Horizontal flex container with children.
VFlex(Vec<Id>)
Vertical flex container with children.
Fill(Id)
Fill remaining space in container.
Trait Implementations§
impl Eq for Expr
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 UnsafeUnpin 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