[−][src]Struct libslide::evaluator_rules::rule::PatternMap
A mapping between two expression patterns.
Fields
from: RcExprPat
to: RcExprPat
Implementations
impl PatternMap
[src]
pub fn from_str(rule: &str) -> Self
[src]
Converts a string representation of a rule to a PatternMap
.
A rule's string form must be
"<expr> -> <expr>"
Where <expr>
is an expression pattern.
pub fn bootstrap(&self, bootstrapping_rules: &[Rule]) -> Self
[src]
Bootstraps a PatternMap
rule with a one-pass application of a rule set, which may include
the rule itself.
This allows the rule to match evaluated contexts that cannot be represented by a
PatternMap
created from just a string form. For example, the rule
"-(_a - _b) -> _b - _a"
in its raw form may only be applied to an expression with explicit parentheses. By
bootstrapping this rule with a rule that removes explicit parentheses, the rule can be
applied on expressions with implicit parentheses (i.e. of the prefix form (- (- _a _b))
).
pub fn validate(&self) -> Result<(), UnresolvedMapping>
[src]
Checks a PatternMap
is resolvable, returning an error if it is not.
Trait Implementations
impl Clone for PatternMap
[src]
fn clone(&self) -> PatternMap
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for PatternMap
[src]
impl Display for PatternMap
[src]
Auto Trait Implementations
impl RefUnwindSafe for PatternMap
impl Send for PatternMap
impl Sync for PatternMap
impl Unpin for PatternMap
impl UnwindSafe for PatternMap
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> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
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>,