Struct parser_compose::Predicate
source · pub struct Predicate<P, F> { /* private fields */ }
Expand description
See when()
Trait Implementations§
source§impl<In, Out, P, F> Parser<In> for Predicate<P, F>
impl<In, Out, P, F> Parser<In> for Predicate<P, F>
source§fn try_parse(&self, input: In) -> Option<(Self::Out, In)>
fn try_parse(&self, input: In) -> Option<(Self::Out, In)>
Recognizes a value from the input and returns the result Read more
source§fn map<F, Mapped>(self, f: F) -> Map<Self, F>
fn map<F, Mapped>(self, f: F) -> Map<Self, F>
Returns a parser that applies the function
f
to its output Read moresource§fn or<P>(self, next: P) -> Or<Self, P>where
Self: Sized,
fn or<P>(self, next: P) -> Or<Self, P>where
Self: Sized,
Returns a parser that calls the
next
parser if it fails to match its input. Read moresource§fn fold<R, Op, Init, IV>(
self,
count: R,
op: Op,
init: Init
) -> Fold<Self, Op, Init>
fn fold<R, Op, Init, IV>( self, count: R, op: Op, init: Init ) -> Fold<Self, Op, Init>
Returns a parser that succeeds if it is able to match its input
count
times. Read moresource§fn repeats<R>(
self,
count: R
) -> Fold<Self, RepeatsOperation<Self::Out>, RepeatsInit>where
Self: Sized,
R: RepetitionArgument,
fn repeats<R>(
self,
count: R
) -> Fold<Self, RepeatsOperation<Self::Out>, RepeatsInit>where
Self: Sized,
R: RepetitionArgument,
Returns a parser that succeeds if it is able to match its input
count
times, discarding
any output along the way Read moresource§fn accumulate<R>(
self,
count: R
) -> Fold<Self, AccumulateOperation<Self::Out>, AccumulateInit<Self::Out>>where
R: RepetitionArgument,
Self: Sized,
fn accumulate<R>(
self,
count: R
) -> Fold<Self, AccumulateOperation<Self::Out>, AccumulateInit<Self::Out>>where
R: RepetitionArgument,
Self: Sized,
Returns a parser that succeeds if it is able to match its input
count
times, accumulating
output into a Vec
along the way. Read moresource§fn input(self) -> Input<Self>where
Self: Sized,
fn input(self) -> Input<Self>where
Self: Sized,
Returns a parser that outputs the slice of the input that was recognized. Read more
source§fn peek(self) -> Peek<Self>where
Self: Sized,
fn peek(self) -> Peek<Self>where
Self: Sized,
Returns a parser that never consumes any input regardless of its outcome. It can be used to
look ahead. Read more
impl<P: Copy, F: Copy> Copy for Predicate<P, F>
Auto Trait Implementations§
impl<P, F> RefUnwindSafe for Predicate<P, F>where
F: RefUnwindSafe,
P: RefUnwindSafe,
impl<P, F> Send for Predicate<P, F>
impl<P, F> Sync for Predicate<P, F>
impl<P, F> Unpin for Predicate<P, F>
impl<P, F> UnwindSafe for Predicate<P, F>where
F: UnwindSafe,
P: UnwindSafe,
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