[][src]Struct libslide::evaluator_rules::pattern_match::PatternMatch

pub struct PatternMatch<E: RcExpression> {
    map: HashMap<u64, E>,
}

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]

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]

impl MatchRule<RcExprPat> for PatternMatch<RcExprPat>[src]

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

impl<E> Send for PatternMatch<E> where
    E: Send

impl<E> Sync for PatternMatch<E> where
    E: Sync

impl<E> Unpin for PatternMatch<E> where
    E: Unpin

impl<E> UnwindSafe for PatternMatch<E> where
    E: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.