add Expr type for union of BoolExpr or NumExpr
This commit is contained in:
parent
7c81b30a8f
commit
6632e897ba
6 changed files with 32 additions and 22 deletions
|
|
@ -4,7 +4,7 @@ use super::{BoolExpr, ExprRef, NumExpr};
|
|||
|
||||
/// A trait representing expressions
|
||||
#[enum_dispatch]
|
||||
pub trait Expr {
|
||||
pub trait AnyExpr {
|
||||
/// Check if the given expression is a numeric expression
|
||||
fn is_numeric(&self) -> bool;
|
||||
/// Check if the given expression is a boolean expression
|
||||
|
|
@ -17,7 +17,7 @@ pub trait Expr {
|
|||
}
|
||||
|
||||
/// Marker trait for numeric expressions
|
||||
pub trait IsNumExpr: Expr + Into<NumExpr> {}
|
||||
pub trait IsNumExpr: AnyExpr + Into<NumExpr> {}
|
||||
|
||||
/// Marker trait for Boolean expressions
|
||||
pub trait IsBoolExpr: Expr + Into<BoolExpr> {}
|
||||
pub trait IsBoolExpr: AnyExpr + Into<BoolExpr> {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue