pub struct SesRewriteRule {
pub name: String,
pub pattern: String,
pub applies: fn(&SesExpr) -> bool,
pub transform: Box<dyn Fn(SesExpr) -> SesExpr + Send + Sync>,
}Expand description
A named rewrite rule for the simplifier.
Fields§
§name: StringHuman-readable name for the rule.
pattern: StringA short pattern description string (informational only).
applies: fn(&SesExpr) -> boolPredicate: returns true when this rule can be applied to expr.
transform: Box<dyn Fn(SesExpr) -> SesExpr + Send + Sync>Transformation: consumes the expression and returns the simplified form.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for SesRewriteRule
impl !UnwindSafe for SesRewriteRule
impl Freeze for SesRewriteRule
impl Send for SesRewriteRule
impl Sync for SesRewriteRule
impl Unpin for SesRewriteRule
impl UnsafeUnpin for SesRewriteRule
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more