[−][src]Enum libslide::evaluator_rules::unbuilt_rule::UnbuiltRule
An unbuilt rule, generally used to express a rule in a human-readable form.
Variants
S(&'static str)
An expression-mapping rule.
A string rule is of the form
"<expr> -> <expr>"
Where
pattern | matches |
---|---|
# | A constant |
$ | A variable |
_ | Any expression |
To apply a rule, the lhs of the rule is pattern matched on the target expression. If the matching is sucessful, the rhs of the rule is expanded with the results of the matching.
For example, the rule
"$a + 0 -> $a"
Applied on the expression "x + 0"
would yield "x"
.
Note that mapping rules are built as, matched with, and applied on expression parse trees rather than the string representations of expressions. This ensures rule application is always exact and deterministic.
M(&'static [&'static str])
Multiple string rules. This should be used by rules that are only fully expressed by multiple similar transformations.
A function rule.
Trait Implementations
impl Clone for UnbuiltRule
[src]
fn clone(&self) -> UnbuiltRule
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for UnbuiltRule
[src]
impl From<&'static str> for UnbuiltRule
[src]
Auto Trait Implementations
impl RefUnwindSafe for UnbuiltRule
impl Send for UnbuiltRule
impl Sync for UnbuiltRule
impl Unpin for UnbuiltRule
impl UnwindSafe for UnbuiltRule
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>,