pub enum Expr<T> {
Show 15 variants
Not(Box<Expr<T>>),
And(Vec<Expr<T>>),
Or(Vec<Expr<T>>),
Eq(Box<[Expr<T>; 2]>),
Add(Box<[Expr<T>; 2]>),
Sub(Box<[Expr<T>; 2]>),
Mul(Box<[Expr<T>; 2]>),
BitNot(Box<Expr<T>>),
BitAnd(Box<[Expr<T>; 2]>),
BitOr(Box<[Expr<T>; 2]>),
BitShl(Box<[Expr<T>; 2]>),
BitShr(Box<[Expr<T>; 2]>),
TypeProperty(T, String),
Ref(T),
Const(Value),
}Expand description
An expression, parameterized over the domain of references.
A reference can be:
- An identifier, on the syntactic level,
- an
R, for the expanded representation, - a field index (
usize) when executing.
Variants§
Not(Box<Expr<T>>)
And(Vec<Expr<T>>)
Or(Vec<Expr<T>>)
Eq(Box<[Expr<T>; 2]>)
Add(Box<[Expr<T>; 2]>)
Sub(Box<[Expr<T>; 2]>)
Mul(Box<[Expr<T>; 2]>)
BitNot(Box<Expr<T>>)
BitAnd(Box<[Expr<T>; 2]>)
BitOr(Box<[Expr<T>; 2]>)
BitShl(Box<[Expr<T>; 2]>)
BitShr(Box<[Expr<T>; 2]>)
TypeProperty(T, String)
Ref(T)
Const(Value)
Implementations§
Source§impl<T> Expr<T>
impl<T> Expr<T>
pub fn constant(value: impl Into<Value>) -> Self
pub fn equal(e1: impl Into<Expr<T>>, e2: impl Into<Expr<T>>) -> Self
pub fn add(e1: impl Into<Expr<T>>, e2: impl Into<Expr<T>>) -> Self
pub fn sub(e1: impl Into<Expr<T>>, e2: impl Into<Expr<T>>) -> Self
pub fn mul(e1: impl Into<Expr<T>>, e2: impl Into<Expr<T>>) -> Self
pub fn bitwise_not(e: impl Into<Expr<T>>) -> Self
pub fn bitwise_and(e1: impl Into<Expr<T>>, e2: impl Into<Expr<T>>) -> Self
pub fn bitwise_or(e1: impl Into<Expr<T>>, e2: impl Into<Expr<T>>) -> Self
pub fn bitwise_shift_left( e1: impl Into<Expr<T>>, e2: impl Into<Expr<T>>, ) -> Self
pub fn bitwise_shift_right( e1: impl Into<Expr<T>>, e2: impl Into<Expr<T>>, ) -> Self
pub fn simplified(self) -> Self
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Expr<T>where
T: Freeze,
impl<T> RefUnwindSafe for Expr<T>where
T: RefUnwindSafe,
impl<T> Send for Expr<T>where
T: Send,
impl<T> Sync for Expr<T>where
T: Sync,
impl<T> Unpin for Expr<T>where
T: Unpin,
impl<T> UnsafeUnpin for Expr<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Expr<T>where
T: UnwindSafe,
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