[−][src]Struct libslide::evaluator_rules::pattern_match::PatternMatch
Represents pattern-matched replacements betwen a rule and a target expression.
The rhs of a rule may be transfomed with an instance of PatternMatch
to obtain the result of a
rule applied on a target expression.
Fields
map: HashMap<u64, E>
Implementations
impl<E: RcExpression + Eq> PatternMatch<E>
[src]
fn try_merge(
left: PatternMatch<E>,
right: PatternMatch<E>
) -> Option<PatternMatch<E>>
[src]
left: PatternMatch<E>,
right: PatternMatch<E>
) -> Option<PatternMatch<E>>
Merges two PatternMatch
. If the PatternMatch
are of incompatible state (i.e. contain
different mappings), merging fails and nothing is returned.
fn insert(&mut self, k: &RcExprPat, v: E) -> Option<E>
[src]
Trait Implementations
impl<E: RcExpression> Default for PatternMatch<E>
[src]
impl MatchRule<RcExpr> for PatternMatch<RcExpr>
[src]
fn match_rule(rule: RcExprPat, target: RcExpr) -> Option<PatternMatch<RcExpr>>
[src]
impl MatchRule<RcExprPat> for PatternMatch<RcExprPat>
[src]
fn match_rule(
rule: RcExprPat,
target: RcExprPat
) -> Option<PatternMatch<RcExprPat>>
[src]
rule: RcExprPat,
target: RcExprPat
) -> Option<PatternMatch<RcExprPat>>
impl Transformer<RcExprPat, RcExpr> for PatternMatch<RcExpr>
[src]
fn transform(&self, item: RcExprPat) -> RcExpr
[src]
Transforms a pattern expression into an expression by replacing patterns with target
expressions known by the PatternMatch
.
This transformation can be used to apply a rule on an expression by transforming the RHS using patterns matched between the LHS of the rule and the target expression.
impl Transformer<RcExprPat, RcExprPat> for PatternMatch<RcExprPat>
[src]
Auto Trait Implementations
impl<E> RefUnwindSafe for PatternMatch<E> where
E: RefUnwindSafe,
E: RefUnwindSafe,
impl<E> Send for PatternMatch<E> where
E: Send,
E: Send,
impl<E> Sync for PatternMatch<E> where
E: Sync,
E: Sync,
impl<E> Unpin for PatternMatch<E> where
E: Unpin,
E: Unpin,
impl<E> UnwindSafe for PatternMatch<E> where
E: UnwindSafe,
E: UnwindSafe,
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, 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>,