pub trait Canonicalwhere
Self: Sized,{
// Required methods
fn expr_is_canonical(expr: &RecExpr<Self>) -> bool;
fn canonicalize_expr(expr: RecExpr<Self>) -> RecExpr<Self>;
fn verify_expr(expr: &RecExpr<Self>) -> Result<(), String>;
}Expand description
A trait to represent that a language can be canonicalized.
Required Methods§
Sourcefn expr_is_canonical(expr: &RecExpr<Self>) -> bool
fn expr_is_canonical(expr: &RecExpr<Self>) -> bool
Returns true if the expression is canonical.
Sourcefn canonicalize_expr(expr: RecExpr<Self>) -> RecExpr<Self>
fn canonicalize_expr(expr: RecExpr<Self>) -> RecExpr<Self>
Returns a canonicalization of the expression.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.