pub struct RepeatParser<P> { /* private fields */ }Expand description
A parser for a repeat of two parsers.
Implementations§
Source§impl<P> RepeatParser<P>
impl<P> RepeatParser<P>
Sourcepub fn new(parser: P, length_range: RangeInclusive<usize>) -> RepeatParser<P>
pub fn new(parser: P, length_range: RangeInclusive<usize>) -> RepeatParser<P>
Create a new repeat parser.
Trait Implementations§
Source§impl<P> Clone for RepeatParser<P>where
P: Clone,
impl<P> Clone for RepeatParser<P>where
P: Clone,
Source§fn clone(&self) -> RepeatParser<P>
fn clone(&self) -> RepeatParser<P>
Returns a duplicate 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<O, PA, P> CreateParserState for RepeatParser<P>where
P: Parser<Output = O, PartialState = PA> + CreateParserState,
<P as Parser>::PartialState: Clone,
<P as Parser>::Output: Clone,
impl<O, PA, P> CreateParserState for RepeatParser<P>where
P: Parser<Output = O, PartialState = PA> + CreateParserState,
<P as Parser>::PartialState: Clone,
<P as Parser>::Output: Clone,
Source§fn create_parser_state(&self) -> <RepeatParser<P> as Parser>::PartialState
fn create_parser_state(&self) -> <RepeatParser<P> as Parser>::PartialState
Create the default state of the parser.
Source§impl<P> Debug for RepeatParser<P>where
P: Debug,
impl<P> Debug for RepeatParser<P>where
P: Debug,
Source§impl<P> Default for RepeatParser<P>where
P: Default,
impl<P> Default for RepeatParser<P>where
P: Default,
Source§fn default() -> RepeatParser<P>
fn default() -> RepeatParser<P>
Returns the “default value” for a type. Read more
Source§impl<O, PA, P> Parser for RepeatParser<P>where
P: Parser<Output = O, PartialState = PA> + CreateParserState,
<P as Parser>::PartialState: Clone,
<P as Parser>::Output: Clone,
impl<O, PA, P> Parser for RepeatParser<P>where
P: Parser<Output = O, PartialState = PA> + CreateParserState,
<P as Parser>::PartialState: Clone,
<P as Parser>::Output: Clone,
Source§type PartialState = RepeatParserState<P>
type PartialState = RepeatParserState<P>
The state of the parser.
Source§fn parse<'a>(
&self,
state: &<RepeatParser<P> as Parser>::PartialState,
input: &'a [u8],
) -> Result<ParseStatus<'a, <RepeatParser<P> as Parser>::PartialState, <RepeatParser<P> as Parser>::Output>, ParserError>
fn parse<'a>( &self, state: &<RepeatParser<P> as Parser>::PartialState, input: &'a [u8], ) -> Result<ParseStatus<'a, <RepeatParser<P> as Parser>::PartialState, <RepeatParser<P> as Parser>::Output>, ParserError>
Parse the given input.
Source§impl<P> PartialEq for RepeatParser<P>where
P: PartialEq,
impl<P> PartialEq for RepeatParser<P>where
P: PartialEq,
impl<P> Eq for RepeatParser<P>where
P: Eq,
impl<P> StructuralPartialEq for RepeatParser<P>
Auto Trait Implementations§
impl<P> Freeze for RepeatParser<P>where
P: Freeze,
impl<P> RefUnwindSafe for RepeatParser<P>where
P: RefUnwindSafe,
impl<P> Send for RepeatParser<P>where
P: Send,
impl<P> Sync for RepeatParser<P>where
P: Sync,
impl<P> Unpin for RepeatParser<P>where
P: Unpin,
impl<P> UnwindSafe for RepeatParser<P>where
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§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<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
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<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 moreSource§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
Source§impl<P> ModelConstraints for Pwhere
P: Parser,
impl<P> ModelConstraints for Pwhere
P: Parser,
Source§impl<P> ParserExt for Pwhere
P: Parser,
impl<P> ParserExt for Pwhere
P: Parser,
Source§fn otherwise<V>(self, other: V) -> ChoiceParser<Self, V>
fn otherwise<V>(self, other: V) -> ChoiceParser<Self, V>
Parse this parser, or another other parser.
Source§fn or<V>(self, other: V) -> MapOutputParser<ChoiceParser<Self, V>, Self::Output>
fn or<V>(self, other: V) -> MapOutputParser<ChoiceParser<Self, V>, Self::Output>
Parse this parser, or another other parser with the same type
Source§fn then<V>(self, other: V) -> SequenceParser<Self, V>
fn then<V>(self, other: V) -> SequenceParser<Self, V>
Parse this parser, then the other parser.
Source§fn then_lazy<V, F>(self, other: F) -> ThenLazy<Self, F>
fn then_lazy<V, F>(self, other: F) -> ThenLazy<Self, F>
Parse this parser, then the other parser that is created base on the output of this parser.
Source§fn ignore_output_then<V>(
self,
other: V,
) -> MapOutputParser<SequenceParser<Self, V>, <V as Parser>::Output>where
V: CreateParserState,
Self: Sized,
fn ignore_output_then<V>(
self,
other: V,
) -> MapOutputParser<SequenceParser<Self, V>, <V as Parser>::Output>where
V: CreateParserState,
Self: Sized,
Parse this parser, then the other parser while ignoring the current parser’s output.
Source§fn then_ignore_output<V>(
self,
other: V,
) -> MapOutputParser<SequenceParser<Self, V>, Self::Output>where
V: CreateParserState,
Self: Sized,
fn then_ignore_output<V>(
self,
other: V,
) -> MapOutputParser<SequenceParser<Self, V>, Self::Output>where
V: CreateParserState,
Self: Sized,
Parse this parser, then the other parser while ignoring the output of the other parser.
Source§fn then_literal(
self,
literal: impl Into<Cow<'static, str>>,
) -> MapOutputParser<SequenceParser<Self, LiteralParser>, Self::Output>where
Self: Sized,
fn then_literal(
self,
literal: impl Into<Cow<'static, str>>,
) -> MapOutputParser<SequenceParser<Self, LiteralParser>, Self::Output>where
Self: Sized,
Parse this parser, then a literal. This is equivalent to
.then_ignore_output(LiteralParser::new(literal)).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, O>(self, f: F) -> MapOutputParser<Self, O, F>
fn map_output<F, O>(self, f: F) -> MapOutputParser<Self, O, F>
Map the output of this parser.
Source§fn boxed(self) -> ArcParser<Self::Output>where
Self: Sized + CreateParserState + Send + Sync + 'static,
Self::Output: Send + Sync + 'static,
Self::PartialState: Send + Sync + 'static,
fn boxed(self) -> ArcParser<Self::Output>where
Self: Sized + CreateParserState + Send + Sync + 'static,
Self::Output: Send + Sync + 'static,
Self::PartialState: Send + Sync + 'static,
Get a boxed version of this parser.
Source§fn with_initial_state<F>(self, initial_state: F) -> WithInitialState<Self, F>
fn with_initial_state<F>(self, initial_state: F) -> WithInitialState<Self, F>
Create a new parser with a different initial state
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().