# Struct pest::pratt_parser::PrattParserMap

source · [−]

    pub struct PrattParserMap<'pratt, 'i, R, F, T> where
        R: RuleType,
        F: FnMut(Pair<'i, R>) -> T, { /* private fields */ }

Expand description

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

## Implementations

source

### impl<'pratt, 'i, R, F, T> PrattParserMap<'pratt, 'i, R, F, T> where
R: RuleType + 'pratt,
F: FnMut(Pair<'i, R>) -> T,

source

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

Maps prefix operators with closure `prefix`.

source

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

Maps postfix operators with closure `postfix`.

source

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

Maps infix operators with a closure `infix`.

source

#### pub fn parse<P: Iterator<Item = Pair<'i, R>>>(&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).

## Auto Trait Implementations

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

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

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

### impl<'pratt, 'i, R, F, T> Unpin for PrattParserMap<'pratt, 'i, R, F, T> where
F: Unpin,
T: Unpin,

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

## Blanket Implementations

source

### impl<T> Any for T where
T: 'static + ?Sized,

source

#### fn type_id(&self) -> TypeId

Gets the `TypeId` of `self`. Read more

source

### impl<T> Borrow<T> for T where
T: ?Sized,

const: unstable · source

#### fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more

source

### impl<T> BorrowMut<T> for T where
T: ?Sized,

const: unstable · source

#### fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more

source

### impl<T> From<T> for T

const: unstable · source

#### fn from(t: T) -> T

Returns the argument unchanged.

source

### impl<T, U> Into<U> for T where
U: From<T>,

const: unstable · source

#### fn into(self) -> U

Calls `U::from(self)`.

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

source

### impl<T, U> TryFrom<U> for T where
U: Into<T>,

#### type Error = Infallible

The type returned in the event of a conversion error.

const: unstable · source

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

Performs the conversion.

source

### impl<T, U> TryInto<U> for T where
U: TryFrom<T>,

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

The type returned in the event of a conversion error.

const: unstable · source

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

Performs the conversion.