Struct lip::UpdateState
source · pub struct UpdateState<P, F>(_, _);
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 copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<'a, P, F> Parser<'a> for UpdateState<P, F>where
P: Parser<'a> + 'a,
F: Fn(&P::Output, P::State) -> P::State,
impl<'a, P, F> Parser<'a> for UpdateState<P, F>where P: Parser<'a> + 'a, F: Fn(&P::Output, P::State) -> P::State,
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>where
Self: Sized + 'a,
F: Fn(Self::Output) -> NewOutput + 'a,
fn map<F, NewOutput: 'a>(self, map_fn: F) -> Map<Self, F>where Self: Sized + 'a, F: Fn(Self::Output) -> NewOutput + 'a,
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>where
Self: Sized + 'a,
F: Fn(Self::Output, Self::State) -> NewOutput + 'a,
fn map_with_state<F, NewOutput: 'a>(self, map_fn: F) -> MapWithState<Self, F>where Self: Sized + 'a, F: Fn(Self::Output, Self::State) -> NewOutput + 'a,
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>where
Self: Sized + 'a,
F: Fn(String) -> String,
fn map_err<F>(self, map_fn: F) -> MapErr<Self, F>where Self: Sized + 'a, F: Fn(String) -> String,
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>where
Self: Sized + 'a,
P2: Parser<'a, Output = B>,
F: Fn(Self::Output) -> P2,
fn and_then<F, P2, B>(self, f: F) -> AndThen<Self, F>where Self: Sized + 'a, P2: Parser<'a, Output = B>, F: Fn(Self::Output) -> P2,
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>where
Self: Sized + 'a,
F: Fn(&Self::Output) -> bool,
fn pred<F>(self, predicate: F, expecting: &'a str) -> Pred<'_, Self, F>where Self: Sized + 'a, F: Fn(&Self::Output) -> bool,
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>where
Self: Sized + 'a,
F: Fn(Self::Output, Self::State) -> Self::State,
fn update_state<F>(self, f: F) -> UpdateState<Self, F>where Self: Sized + 'a, F: Fn(Self::Output, Self::State) -> Self::State,
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>where
Self: Sized + 'a,
F: FnOnce(&'a str, Self::Output, Location, Self::State) -> ParseResult<'a, B, Self::State> + Clone,
fn update<B, F>(self, f: F) -> Update<Self, F>where Self: Sized + 'a, F: FnOnce(&'a str, Self::Output, Location, Self::State) -> ParseResult<'a, B, Self::State> + Clone,
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 skip<P2>(self, ignored_parser: P2) -> Skip<Self, P2>where
Self: Sized + 'a,
P2: Parser<'a>,
fn skip<P2>(self, ignored_parser: P2) -> Skip<Self, P2>where Self: Sized + 'a, P2: Parser<'a>,
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>where Self: Sized + 'a, T2: Parser<'a, Output = Self::Output, State = Self::State>,
fn second_of_two<T1>(self) -> OneOfTwo<T1, Self>where Self: Sized + 'a, T1: Parser<'a, Output = Self::Output, State = Self::State>,
fn first_of_three<T2, T3>(self) -> OneOfThree<Self, T2, T3>where Self: Sized + 'a, T2: Parser<'a, Output = Self::Output, State = Self::State>, T3: Parser<'a, Output = Self::Output, State = Self::State>,
fn second_of_three<T1, T3>(self) -> OneOfThree<T1, Self, T3>where Self: Sized + 'a, T1: Parser<'a, Output = Self::Output, State = Self::State>, T3: Parser<'a, Output = Self::Output, State = Self::State>,
fn third_of_three<T1, T2>(self) -> OneOfThree<T1, T2, Self>where Self: Sized + 'a, T1: Parser<'a, Output = Self::Output, State = Self::State>, T2: Parser<'a, Output = Self::Output, State = Self::State>,
Auto Trait Implementations§
impl<P, F> RefUnwindSafe for UpdateState<P, F>where F: RefUnwindSafe, P: RefUnwindSafe,
impl<P, F> Send for UpdateState<P, F>where F: Send, P: Send,
impl<P, F> Sync for UpdateState<P, F>where F: Sync, P: Sync,
impl<P, F> Unpin for UpdateState<P, F>where F: Unpin, P: Unpin,
impl<P, F> UnwindSafe for UpdateState<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