pub enum NatExpr {
Literal(u64, Span),
Var(Ident),
Add(Box<Self>, Box<Self>, Span),
Mul(Box<Self>, Box<Self>, Span),
}Expand description
A Nat expression (type-level natural number).
Supports literals, variables, addition (Level 1), and multiplication (Level 2).
Variants§
Literal(u64, Span)
An integer literal, e.g., 3
Var(Ident)
A variable (generic Nat parameter), e.g., N
Add(Box<Self>, Box<Self>, Span)
Addition of two nat expressions, e.g., N + 1, M + N
Mul(Box<Self>, Box<Self>, Span)
Multiplication of two nat expressions, e.g., N * 3, M * N
Implementations§
Trait Implementations§
Source§impl FormatEquivalent for NatExpr
impl FormatEquivalent for NatExpr
Source§fn format_equivalent(&self, other: &Self) -> bool
fn format_equivalent(&self, other: &Self) -> bool
Returns
true if self and other are equivalent up to formatting.Auto Trait Implementations§
impl Freeze for NatExpr
impl RefUnwindSafe for NatExpr
impl Send for NatExpr
impl Sync for NatExpr
impl Unpin for NatExpr
impl UnsafeUnpin for NatExpr
impl UnwindSafe for NatExpr
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