Recursive

Trait Recursive 

Source
pub trait Recursive: Functor + Sized
where AsLanguage<Self>: Language,
{ // Required methods fn unwrap(self) -> Signature<Self, Self>; fn wrap(inner: Signature<Self, Self>) -> Self; fn sclone<T: Clone>(sig: &Signature<Self, T>) -> Signature<Self, T>; fn sig_each_ref<T>(refs: &Signature<Self, T>) -> Signature<Self, &T>; // Provided methods fn add_into_rec_expr(self, expr: &mut RecExpr<Signature<Self, Id>>) -> Id { ... } fn into_rec_expr(self) -> (RecExpr<Signature<Self, Id>>, Id) { ... } fn from_rec_expr(expr: &RecExpr<Signature<Self, Id>>, id: Id) -> Self { ... } }
Expand description

A recursive language, which can be converted to and from a RecExpr.

In this case, <Self as Functor>::Container<T> plays a role of a language signature of language L, that is, primitive terms with parameters T (hence the synonym Signature<L, T>). Corresponding Language in egg must be AsLanguage<Self> (e.g. Signature<L, Id>).

Required Methods§

Source

fn unwrap(self) -> Signature<Self, Self>

Unwraps a recursion by one-level.

Source

fn wrap(inner: Signature<Self, Self>) -> Self

Wraps a recursion by one-level.

Source

fn sclone<T: Clone>(sig: &Signature<Self, T>) -> Signature<Self, T>

Structural clone

Source

fn sig_each_ref<T>(refs: &Signature<Self, T>) -> Signature<Self, &T>

Converts a reference to a signature into a signature of references.

Provided Methods§

Source

fn add_into_rec_expr(self, expr: &mut RecExpr<Signature<Self, Id>>) -> Id

Adds into an existing RecExpr and returns the id of the root node.

Source

fn into_rec_expr(self) -> (RecExpr<Signature<Self, Id>>, Id)

Converts into a RecExpr.

Source

fn from_rec_expr(expr: &RecExpr<Signature<Self, Id>>, id: Id) -> Self

Converts from a RecExpr.

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§