pub struct Transform<R, R2, P: Parser<Result = R>, F: Fn(R) -> ParseResult<R2>> { /* private fields */ }
Expand description
Transform applies a function (which may fail) to the result of a parser. Transform only succeeds if the applied function succeeds, too.
Implementations§
Trait Implementations§
Source§impl<R, R2, P: Parser<Result = R>, F: Fn(R) -> ParseResult<R2>> Parser for Transform<R, R2, P, F>
impl<R, R2, P: Parser<Result = R>, F: Fn(R) -> ParseResult<R2>> Parser for Transform<R, R2, P, F>
type Result = R2
Source§fn parse(
&mut self,
st: &mut ParseState<impl Iterator<Item = char>>,
) -> ParseResult<Self::Result>
fn parse( &mut self, st: &mut ParseState<impl Iterator<Item = char>>, ) -> ParseResult<Self::Result>
parse consumes input from
st
and returns a result or an error. Read moreAuto Trait Implementations§
impl<R, R2, P, F> Freeze for Transform<R, R2, P, F>
impl<R, R2, P, F> RefUnwindSafe for Transform<R, R2, P, F>where
F: RefUnwindSafe,
P: RefUnwindSafe,
impl<R, R2, P, F> Send for Transform<R, R2, P, F>
impl<R, R2, P, F> Sync for Transform<R, R2, P, F>
impl<R, R2, P, F> Unpin for Transform<R, R2, P, F>
impl<R, R2, P, F> UnwindSafe for Transform<R, R2, 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