pub struct UpdateState<P, F>(/* private fields */);
Trait Implementations§
Source§impl<P: Clone, F: Clone> Clone for UpdateState<P, F>
impl<P: Clone, F: Clone> Clone for UpdateState<P, F>
Source§fn clone(&self) -> UpdateState<P, F>
fn clone(&self) -> UpdateState<P, F>
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<'a, P, F> Parser<'a> for UpdateState<P, F>
impl<'a, P, F> Parser<'a> for UpdateState<P, F>
type Output = <P as Parser<'a>>::Output
type State = <P as Parser<'a>>::State
Source§fn parse(
&mut self,
input: &'a str,
location: Location,
state: Self::State,
) -> ParseResult<'a, Self::Output, Self::State>
fn parse( &mut self, input: &'a str, location: Location, state: Self::State, ) -> ParseResult<'a, Self::Output, Self::State>
Parse a given input, starting at
a given location and state.
Source§fn run(
&mut self,
input: &'a str,
state: Self::State,
) -> ParseResult<'a, Self::Output, Self::State>
fn run( &mut self, input: &'a str, state: Self::State, ) -> ParseResult<'a, Self::Output, Self::State>
Run the parser on a given input, starting at
the first character. Read more
Source§fn map<F, NewOutput: 'a>(self, map_fn: F) -> Map<Self, F>
fn map<F, NewOutput: 'a>(self, map_fn: F) -> Map<Self, F>
Map the output to a new output if parse succeeds.
Otherwise, return error as usual. Read more
Source§fn map_with_state<F, NewOutput: 'a>(self, map_fn: F) -> MapWithState<Self, F>
fn map_with_state<F, NewOutput: 'a>(self, map_fn: F) -> MapWithState<Self, F>
The map function is supplied both the output and the
state of the parser.
Otherwise, return error as usual. Read more
Source§fn map_err<F>(self, map_fn: F) -> MapErr<Self, F>
fn map_err<F>(self, map_fn: F) -> MapErr<Self, F>
Map the error message to a new message if parse fails.
Otherwise, return output as usual. Read more
Source§fn and_then<F, P2, B>(self, f: F) -> AndThen<Self, F>
fn and_then<F, P2, B>(self, f: F) -> AndThen<Self, F>
Returns a new parser which is given the current output if parse succeeds.
Otherwise, return error as usual. Read more
Source§fn pred<F>(self, predicate: F, expecting: &'a str) -> Pred<'_, Self, F>
fn pred<F>(self, predicate: F, expecting: &'a str) -> Pred<'_, Self, F>
Judge if the output meets the requirement using a predicate function
if the parse succeeds. Otherwise, return error as usual.
Source§fn ignore(self) -> Ignore<Self>where
Self: Sized + 'a,
fn ignore(self) -> Ignore<Self>where
Self: Sized + 'a,
Ignore the parse output and return
()
(emtpy tuple)Source§fn update_state<F>(self, f: F) -> UpdateState<Self, F>
fn update_state<F>(self, f: F) -> UpdateState<Self, F>
Update the state given the new output and state of the parse if parse succeeds.
Otherwise, return error as usual.
Source§fn update<B, F>(self, f: F) -> Update<Self, F>
fn update<B, F>(self, f: F) -> Update<Self, F>
Update the result of the parser if parse succeeds.
Otherwise, return error as usual. Read more
Source§fn end(self) -> End<Self>where
Self: Sized + 'a,
fn end(self) -> End<Self>where
Self: Sized + 'a,
Check if you have reached the end of the input you are parsing. Read more
Source§fn keep<A, B, P2>(self, arg_parser: P2) -> Keep<Self, P2>
fn keep<A, B, P2>(self, arg_parser: P2) -> Keep<Self, P2>
Keep values in a parser pipeline. Read more
Source§fn skip<P2>(self, ignored_parser: P2) -> Skip<Self, P2>
fn skip<P2>(self, ignored_parser: P2) -> Skip<Self, P2>
Skip values in a parser pipeline. Read more
fn backtrackable(self) -> Backtrackable<Self>where
Self: Sized + 'a,
fn first_of_two<T2>(self) -> OneOfTwo<Self, T2>
fn second_of_two<T1>(self) -> OneOfTwo<T1, Self>
fn first_of_three<T2, T3>(self) -> OneOfThree<Self, T2, T3>
fn second_of_three<T1, T3>(self) -> OneOfThree<T1, Self, T3>
fn third_of_three<T1, T2>(self) -> OneOfThree<T1, T2, Self>
Auto Trait Implementations§
impl<P, F> Freeze for UpdateState<P, F>
impl<P, F> RefUnwindSafe for UpdateState<P, F>where
P: RefUnwindSafe,
F: RefUnwindSafe,
impl<P, F> Send for UpdateState<P, F>
impl<P, F> Sync for UpdateState<P, F>
impl<P, F> Unpin for UpdateState<P, F>
impl<P, F> UnwindSafe for UpdateState<P, F>where
P: UnwindSafe,
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<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more