Struct kalosm_sample::SequenceParser
source · pub struct SequenceParser<P1, P2> { /* private fields */ }
Expand description
A parser for a sequence of two parsers.
Implementations§
source§impl<P1, P2> SequenceParser<P1, P2>
impl<P1, P2> SequenceParser<P1, P2>
Trait Implementations§
source§impl<P1: Clone, P2: Clone> Clone for SequenceParser<P1, P2>
impl<P1: Clone, P2: Clone> Clone for SequenceParser<P1, P2>
source§fn clone(&self) -> SequenceParser<P1, P2>
fn clone(&self) -> SequenceParser<P1, P2>
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<E1, E2, O1: Clone, O2, PA1, PA2, P1: Parser<Error = E1, Output = O1, PartialState = PA1> + CreateParserState, P2: Parser<Error = E2, Output = O2, PartialState = PA2> + CreateParserState> CreateParserState for SequenceParser<P1, P2>
impl<E1, E2, O1: Clone, O2, PA1, PA2, P1: Parser<Error = E1, Output = O1, PartialState = PA1> + CreateParserState, P2: Parser<Error = E2, Output = O2, PartialState = PA2> + CreateParserState> CreateParserState for SequenceParser<P1, P2>
source§fn create_parser_state(&self) -> <Self as Parser>::PartialState
fn create_parser_state(&self) -> <Self as Parser>::PartialState
Create the default state of the parser.
source§impl<P1: Default, P2: Default> Default for SequenceParser<P1, P2>
impl<P1: Default, P2: Default> Default for SequenceParser<P1, P2>
source§fn default() -> SequenceParser<P1, P2>
fn default() -> SequenceParser<P1, P2>
Returns the “default value” for a type. Read more
source§impl<E1, E2, O1: Clone, O2, PA1, PA2, P1: Parser<Error = E1, Output = O1, PartialState = PA1>, P2: Parser<Error = E2, Output = O2, PartialState = PA2> + CreateParserState> Parser for SequenceParser<P1, P2>
impl<E1, E2, O1: Clone, O2, PA1, PA2, P1: Parser<Error = E1, Output = O1, PartialState = PA1>, P2: Parser<Error = E2, Output = O2, PartialState = PA2> + CreateParserState> Parser for SequenceParser<P1, P2>
§type PartialState = SequenceParserState<PA1, PA2, O1>
type PartialState = SequenceParserState<PA1, PA2, O1>
The state of the parser.
source§fn parse<'a>(
&self,
state: &Self::PartialState,
input: &'a [u8]
) -> Result<ParseResult<'a, Self::PartialState, Self::Output>, Self::Error>
fn parse<'a>( &self, state: &Self::PartialState, input: &'a [u8] ) -> Result<ParseResult<'a, Self::PartialState, Self::Output>, Self::Error>
Parse the given input.
source§impl<P1: PartialEq, P2: PartialEq> PartialEq for SequenceParser<P1, P2>
impl<P1: PartialEq, P2: PartialEq> PartialEq for SequenceParser<P1, P2>
source§fn eq(&self, other: &SequenceParser<P1, P2>) -> bool
fn eq(&self, other: &SequenceParser<P1, P2>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl<P1: Copy, P2: Copy> Copy for SequenceParser<P1, P2>
impl<P1: Eq, P2: Eq> Eq for SequenceParser<P1, P2>
impl<P1, P2> StructuralPartialEq for SequenceParser<P1, P2>
Auto Trait Implementations§
impl<P1, P2> RefUnwindSafe for SequenceParser<P1, P2>where
P1: RefUnwindSafe,
P2: RefUnwindSafe,
impl<P1, P2> Send for SequenceParser<P1, P2>
impl<P1, P2> Sync for SequenceParser<P1, P2>
impl<P1, P2> Unpin for SequenceParser<P1, P2>
impl<P1, P2> UnwindSafe for SequenceParser<P1, P2>where
P1: UnwindSafe,
P2: 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
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<P> ParserExt for Pwhere
P: Parser,
impl<P> ParserExt for Pwhere
P: Parser,
source§fn or<V: Parser<Error = E, Output = O, PartialState = PA>, E, O, PA>(
self,
other: V
) -> ChoiceParser<Self, V>where
Self: Sized,
fn or<V: Parser<Error = E, Output = O, PartialState = PA>, E, O, PA>(
self,
other: V
) -> ChoiceParser<Self, V>where
Self: Sized,
Parse this parser, or another other parser.
source§fn then<V: Parser<Error = E, Output = O, PartialState = PA>, E, O, PA>(
self,
other: V
) -> SequenceParser<Self, V>where
Self: Sized,
fn then<V: Parser<Error = E, Output = O, PartialState = PA>, E, O, PA>(
self,
other: V
) -> SequenceParser<Self, V>where
Self: Sized,
Parse this parser, then the other parser.
source§fn repeat(self, length_range: RangeInclusive<usize>) -> RepeatParser<Self>where
Self: Sized,
fn repeat(self, length_range: RangeInclusive<usize>) -> RepeatParser<Self>where
Self: Sized,
Repeat this parser a number of times.
source§fn map_output<F: Fn(Self::Output) -> O, O>(
self,
f: F
) -> MapOutputParser<Self, F, O>where
Self: Sized,
fn map_output<F: Fn(Self::Output) -> O, O>(
self,
f: F
) -> MapOutputParser<Self, F, O>where
Self: Sized,
Map the output of this parser.