Skip to main content

Canonical

Trait Canonical 

Source
pub trait Canonical
where 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§

Source

fn expr_is_canonical(expr: &RecExpr<Self>) -> bool

Returns true if the expression is canonical.

Source

fn canonicalize_expr(expr: RecExpr<Self>) -> RecExpr<Self>

Returns a canonicalization of the expression.

Source

fn verify_expr(expr: &RecExpr<Self>) -> Result<(), String>

Verify that the expression does not have any extra syntax errors.

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.

Implementors§