Struct PrattParserMap

struct PrattParserMap<'pratt, 'a, 'i, R, F, T> { ... }
where
    R: RuleType,
    F: FnMut(crate::iterators::Pair<'i, R>) -> T

Product of calling map_primary on PrattParser, defines how expressions should be mapped.

Implementations

impl<'pratt, 'a, 'i, R, F, T> PrattParserMap<'pratt, 'a, 'i, R, F, T>

fn map_prefix<X>(self: Self, prefix: X) -> Self
where
    X: FnMut(Pair<'i, R>, T) -> T + 'a

Maps prefix operators with closure prefix.

fn map_postfix<X>(self: Self, postfix: X) -> Self
where
    X: FnMut(T, Pair<'i, R>) -> T + 'a

Maps postfix operators with closure postfix.

fn map_infix<X>(self: Self, infix: X) -> Self
where
    X: FnMut(T, Pair<'i, R>, T) -> T + 'a

Maps infix operators with a closure infix.

fn parse<P: Iterator<Item = Pair<'i, R>>>(self: &mut Self, pairs: P) -> T

The last method to call on the provided pairs to execute the Pratt parser (previously defined using map_primary, map_prefix, map_postfix, and map_infix methods).

impl<'pratt, 'a, 'i, R, F, T> Freeze for PrattParserMap<'pratt, 'a, 'i, R, F, T>

impl<'pratt, 'a, 'i, R, F, T> RefUnwindSafe for PrattParserMap<'pratt, 'a, 'i, R, F, T>

impl<'pratt, 'a, 'i, R, F, T> Send for PrattParserMap<'pratt, 'a, 'i, R, F, T>

impl<'pratt, 'a, 'i, R, F, T> Sync for PrattParserMap<'pratt, 'a, 'i, R, F, T>

impl<'pratt, 'a, 'i, R, F, T> Unpin for PrattParserMap<'pratt, 'a, 'i, R, F, T>

impl<'pratt, 'a, 'i, R, F, T> UnsafeUnpin for PrattParserMap<'pratt, 'a, 'i, R, F, T>

impl<'pratt, 'a, 'i, R, F, T> UnwindSafe for PrattParserMap<'pratt, 'a, 'i, R, F, T>

impl<T> Any for PrattParserMap<'pratt, 'a, 'i, R, F, T>

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for PrattParserMap<'pratt, 'a, 'i, R, F, T>

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for PrattParserMap<'pratt, 'a, 'i, R, F, T>

fn borrow_mut(self: &mut Self) -> &mut T

impl<T> From for PrattParserMap<'pratt, 'a, 'i, R, F, T>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T, U> Into for PrattParserMap<'pratt, 'a, 'i, R, F, T>

fn into(self: Self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom for PrattParserMap<'pratt, 'a, 'i, R, F, T>

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto for PrattParserMap<'pratt, 'a, 'i, R, F, T>

fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>