[][src]Struct kontroli::Rule

pub struct Rule<V, L, R> {
    pub ctx: Vec<V>,
    pub lhs: L,
    pub rhs: R,
}

Rewrite rule.

Fields

ctx: Vec<V>

context (bound variables)

lhs: L

left-hand side (pattern to match with)

rhs: R

right-hand side (term to replace with)

Implementations

impl Rule<Arg<String, Option<Box<Term>>>, Term, Term>[src]

pub fn scope<'s>(self, syms: &Symbols<'s>) -> Result<Rule<'s>, Error>[src]

impl<'s> Rule<String, Application<Symbol<'s>, Pattern<Symbol<'s>>>, RTerm<'s>>[src]

pub fn parse(i: &str, syms: &Symbols<'s>) -> Result<Self, KoError>[src]

Parse a rule and scope it. Used for testing.

Trait Implementations

impl<V: Clone, L: Clone, R: Clone> Clone for Rule<V, L, R>[src]

impl<V: Debug, L: Debug, R: Debug> Debug for Rule<V, L, R>[src]

impl<V, L: Display, R: Display> Display for Rule<V, L, R>[src]

impl<'s> From<Rule<String, Application<Symbol<'s>, Pattern<Symbol<'s>>>, RTerm<'s>>> for Rule<'s>[src]

impl<'s> From<Rule<String, Application<Symbol<'s>, Pattern<Symbol<'s>>>, RTerm<'s>>> for Rule<'s>[src]

Auto Trait Implementations

impl<V, L, R> RefUnwindSafe for Rule<V, L, R> where
    L: RefUnwindSafe,
    R: RefUnwindSafe,
    V: RefUnwindSafe

impl<V, L, R> Send for Rule<V, L, R> where
    L: Send,
    R: Send,
    V: Send

impl<V, L, R> Sync for Rule<V, L, R> where
    L: Sync,
    R: Sync,
    V: Sync

impl<V, L, R> Unpin for Rule<V, L, R> where
    L: Unpin,
    R: Unpin,
    V: Unpin

impl<V, L, R> UnwindSafe for Rule<V, L, R> where
    L: UnwindSafe,
    R: UnwindSafe,
    V: 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> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[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.