[−][src]Struct egg::Rewrite
A rewrite that searches for the lefthand side and applies the righthand side.
The rewrite!
is the easiest way to create rewrites.
A Rewrite
consists principally of a Searcher
(the lefthand
side) and an Applier
(the righthand side).
It additionally stores a name used to refer to the rewrite and a
long name used for debugging.
Implementations
impl<L: Language, N: Analysis<L>> Rewrite<L, N>
[src]
pub fn new(
name: impl Into<String>,
long_name: impl Into<String>,
searcher: impl Searcher<L, N> + 'static,
applier: impl Applier<L, N> + 'static
) -> Self
[src]
name: impl Into<String>,
long_name: impl Into<String>,
searcher: impl Searcher<L, N> + 'static,
applier: impl Applier<L, N> + 'static
) -> Self
pub fn name(&self) -> &str
[src]
Returns the name of the rewrite.
pub fn long_name(&self) -> &str
[src]
Returns the long name of the rewrite which should only be used for debugging and displaying.
pub fn search(&self, egraph: &EGraph<L, N>) -> Vec<SearchMatches>
[src]
pub fn apply(
&self,
egraph: &mut EGraph<L, N>,
matches: &[SearchMatches]
) -> Vec<Id>
[src]
&self,
egraph: &mut EGraph<L, N>,
matches: &[SearchMatches]
) -> Vec<Id>
Call apply_matches
on the Applier
.
Trait Implementations
Auto Trait Implementations
impl<L, N> !RefUnwindSafe for Rewrite<L, N>
impl<L, N> !Send for Rewrite<L, N>
impl<L, N> !Sync for Rewrite<L, N>
impl<L, N> Unpin for Rewrite<L, N>
impl<L, N> !UnwindSafe for Rewrite<L, N>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,