pub struct FromFn<F>(/* private fields */);
Expand description
A parser returned by from_fn
.
Trait Implementations§
Auto Trait Implementations§
impl<F> Freeze for FromFn<F>where
F: Freeze,
impl<F> RefUnwindSafe for FromFn<F>where
F: RefUnwindSafe,
impl<F> Send for FromFn<F>where
F: Send,
impl<F> Sync for FromFn<F>where
F: Sync,
impl<F> Unpin for FromFn<F>where
F: Unpin,
impl<F> UnwindSafe for FromFn<F>where
F: 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<I, S, T> Combinator<I, S> for Twhere
T: Parser<I, S>,
impl<I, S, T> Combinator<I, S> for Twhere
T: Parser<I, S>,
Source§fn then<P: Parser<I, S>>(self, other: P) -> All<(Self, P)>
fn then<P: Parser<I, S>>(self, other: P) -> All<(Self, P)>
If both parsers yield an output, return the pair of their outputs. Read more
Source§fn or<P: Parser<I, S>>(self, other: P) -> Any<(Self, P)>where
I: Clone,
fn or<P: Parser<I, S>>(self, other: P) -> Any<(Self, P)>where
I: Clone,
If the first parser succeeds, return its output, otherwise
return the output of the second parser. Read more
Source§fn map<O, F: FnOnce(Self::O) -> O>(self, f: F) -> Map<Self, F>
fn map<O, F: FnOnce(Self::O) -> O>(self, f: F) -> Map<Self, F>
Apply a function to the output of the parser.
Source§fn map_with<O, F: FnOnce(Self::O, &mut S) -> O>(self, f: F) -> MapWith<Self, F>
fn map_with<O, F: FnOnce(Self::O, &mut S) -> O>(self, f: F) -> MapWith<Self, F>
Apply a function to the output of the parser as well as the mutable state.
Source§fn filter<F: FnOnce(&Self::O) -> bool>(self, f: F) -> Filter<Self, F>
fn filter<F: FnOnce(&Self::O) -> bool>(self, f: F) -> Filter<Self, F>
Succeed only if the given function yields
true
for the parser output.Source§fn filter_map<O, F: FnOnce(Self::O) -> Option<O>>(
self,
f: F,
) -> FilterMap<Self, F>
fn filter_map<O, F: FnOnce(Self::O) -> Option<O>>( self, f: F, ) -> FilterMap<Self, F>
If the given function yields
Some(y)
for the parser output, succeed with y
, else fail.Source§fn then_ignore<P: Parser<I, S>>(
self,
other: P,
) -> Map<All<(Self, P)>, fn((<Self as Parser<I, S>>::O, <P as Parser<I, S>>::O)) -> Self::O>
fn then_ignore<P: Parser<I, S>>( self, other: P, ) -> Map<All<(Self, P)>, fn((<Self as Parser<I, S>>::O, <P as Parser<I, S>>::O)) -> Self::O>
Run two parsers in sequence and discard result of second one.
Source§fn ignore_then<P: Parser<I, S>>(
self,
other: P,
) -> Map<All<(Self, P)>, fn((<Self as Parser<I, S>>::O, <P as Parser<I, S>>::O)) -> P::O>
fn ignore_then<P: Parser<I, S>>( self, other: P, ) -> Map<All<(Self, P)>, fn((<Self as Parser<I, S>>::O, <P as Parser<I, S>>::O)) -> P::O>
Run two parsers in sequence and discard result of first one.
Source§fn delimited_by<L, R>(
self,
l: L,
r: R,
) -> Map<All<(L, Self, R)>, fn((L::O, Self::O, R::O)) -> Self::O>
fn delimited_by<L, R>( self, l: L, r: R, ) -> Map<All<(L, Self, R)>, fn((L::O, Self::O, R::O)) -> Self::O>
Run parsers
l
, self
, and r
in sequence and return only the output of self
.Source§fn repeated<O>(self) -> Repeated<Self, fn() -> O>
fn repeated<O>(self) -> Repeated<Self, fn() -> O>
Apply the given parser as often as possible. Read more
Source§fn separated_by<Sep, O>(self, sep: Sep) -> SeparatedBy<Self, Sep, fn() -> O>
fn separated_by<Sep, O>(self, sep: Sep) -> SeparatedBy<Self, Sep, fn() -> O>
Apply the given parser as often as possible, separated by
sep
. Read moreSource§fn chain<P>(
self,
other: P,
) -> Map<All<(Self, P)>, fn((<Self as Parser<I, S>>::O, <P as Parser<I, S>>::O)) -> Chain<<Self::O as IntoIterator>::IntoIter, <P::O as IntoIterator>::IntoIter>>where
P: Parser<I, S>,
Self::O: IntoIterator,
P::O: IntoIterator<Item = <Self::O as IntoIterator>::Item>,
fn chain<P>(
self,
other: P,
) -> Map<All<(Self, P)>, fn((<Self as Parser<I, S>>::O, <P as Parser<I, S>>::O)) -> Chain<<Self::O as IntoIterator>::IntoIter, <P::O as IntoIterator>::IntoIter>>where
P: Parser<I, S>,
Self::O: IntoIterator,
P::O: IntoIterator<Item = <Self::O as IntoIterator>::Item>,
Convert the outputs of the given parsers to iterators and concatenate them. Read more