pub enum Expr<K = usize, V = AnyBox> {
Binary(ExprBinary<K, V>),
Nary(ExprNary<K, V>),
Ternary(ExprTernary<K, V>),
Unary(ExprUnary<K, V>),
Constant(V),
Variable {
id: IndexId<K>,
value: V,
},
}
Variants§
Binary(ExprBinary<K, V>)
Nary(ExprNary<K, V>)
Ternary(ExprTernary<K, V>)
Unary(ExprUnary<K, V>)
Constant(V)
Variable
Implementations§
Source§impl<K, V> Expr<K, V>
impl<K, V> Expr<K, V>
Sourcepub const fn is_ternary(&self) -> bool
pub const fn is_ternary(&self) -> bool
Returns true if the enum is Expr::Ternary otherwise false
Sourcepub const fn is_constant(&self) -> bool
pub const fn is_constant(&self) -> bool
Returns true if the enum is Expr::Constant otherwise false
Sourcepub const fn is_variable(&self) -> bool
pub const fn is_variable(&self) -> bool
Returns true if the enum is Expr::Variable otherwise false
Source§impl<K, V> Expr<K, V>
impl<K, V> Expr<K, V>
pub fn binary(lhs: Expr<K, V>, rhs: Expr<K, V>, op: BinaryOp) -> Self
pub fn constant(value: V) -> Self
pub fn nary(args: impl IntoIterator<Item = Expr<K, V>>, op: NaryOp) -> Self
pub fn ternary( x: Expr<K, V>, y: Expr<K, V>, z: Expr<K, V>, op: TernaryOp, ) -> Self
pub fn unary(recv: Expr<K, V>, op: UnaryOp) -> Self
pub fn variable(idx: K, value: V) -> Self
pub fn boxed(self) -> Box<Expr<K, V>>
Trait Implementations§
Source§impl<K: Ord, V: Ord> Ord for Expr<K, V>
impl<K: Ord, V: Ord> Ord for Expr<K, V>
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<K: PartialOrd, V: PartialOrd> PartialOrd for Expr<K, V>
impl<K: PartialOrd, V: PartialOrd> PartialOrd for Expr<K, V>
impl<K: Eq, V: Eq> Eq for Expr<K, V>
impl<K, V> StructuralPartialEq for Expr<K, V>
Auto Trait Implementations§
impl<K, V> Freeze for Expr<K, V>
impl<K, V> RefUnwindSafe for Expr<K, V>where
V: RefUnwindSafe,
K: RefUnwindSafe,
impl<K, V> Send for Expr<K, V>
impl<K, V> Sync for Expr<K, V>
impl<K, V> Unpin for Expr<K, V>
impl<K, V> UnwindSafe for Expr<K, V>where
V: UnwindSafe,
K: 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