Struct pest::pratt_parser::PrattParserMap
source · pub struct PrattParserMap<'pratt, 'a, '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, 'a, 'i, R, F, T> PrattParserMap<'pratt, 'a, 'i, R, F, T>where
R: RuleType + 'pratt,
F: FnMut(Pair<'i, R>) -> T,
impl<'pratt, 'a, 'i, R, F, T> PrattParserMap<'pratt, 'a, 'i, R, F, T>where R: RuleType + 'pratt, F: FnMut(Pair<'i, R>) -> T,
sourcepub fn map_prefix<X>(self, prefix: X) -> Selfwhere
X: FnMut(Pair<'i, R>, T) -> T + 'a,
pub fn map_prefix<X>(self, prefix: X) -> Selfwhere X: FnMut(Pair<'i, R>, T) -> T + 'a,
Maps prefix operators with closure prefix
.
sourcepub fn map_postfix<X>(self, postfix: X) -> Selfwhere
X: FnMut(T, Pair<'i, R>) -> T + 'a,
pub fn map_postfix<X>(self, postfix: X) -> Selfwhere X: FnMut(T, Pair<'i, R>) -> T + 'a,
Maps postfix operators with closure postfix
.
sourcepub fn map_infix<X>(self, infix: X) -> Selfwhere
X: FnMut(T, Pair<'i, R>, T) -> T + 'a,
pub fn map_infix<X>(self, infix: X) -> Selfwhere X: FnMut(T, Pair<'i, R>, T) -> T + 'a,
Maps infix operators with a closure infix
.
sourcepub fn parse<P: Iterator<Item = Pair<'i, R>>>(&mut self, pairs: P) -> T
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, '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>where F: Unpin, T: Unpin,
impl<'pratt, 'a, 'i, R, F, T> !UnwindSafe for PrattParserMap<'pratt, 'a, 'i, R, F, T>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more