Collect

Struct Collect 

Source
pub struct Collect<P, Container, Ctx, Lang: ?Sized = ()> { /* private fields */ }
Expand description

A parser that collects results into a container.

Implementations§

Source§

impl<P, Container, Ctx, Lang: ?Sized> Collect<P, Container, Ctx, Lang>

Source

pub const fn as_mut(&mut self) -> Collect<&mut P, &mut Container, Ctx, Lang>

Creates a mutable reference version of this Collect combinator.

Source

pub fn map_parser<F, P2>(self, f: F) -> Collect<P2, Container, Ctx, Lang>
where F: FnOnce(P) -> P2,

Maps the inner parser to a new parser.

Source

pub fn map_container<F, C2>(self, f: F) -> Collect<P, C2, Ctx, Lang>
where F: FnOnce(Container) -> C2,

Maps the inner container to a new container.

Trait Implementations§

Source§

impl<P: Clone, Container: Clone, Ctx: Clone, Lang: Clone + ?Sized> Clone for Collect<P, Container, Ctx, Lang>

Source§

fn clone(&self) -> Collect<P, Container, Ctx, Lang>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<P: Debug, Container: Debug, Ctx: Debug, Lang: Debug + ?Sized> Debug for Collect<P, Container, Ctx, Lang>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<P: Hash, Container: Hash, Ctx: Hash, Lang: Hash + ?Sized> Hash for Collect<P, Container, Ctx, Lang>

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<'inp, 'c, L, F, Condition, O, Container, Ctx, Max, Min, Lang: ?Sized, W> ParseInput<'inp, L, <L as Lexer<'inp>>::Span, Ctx, Lang> for Collect<&'c mut Repeated<F, Condition, O, W, RepeatedOptions<Max, Min>>, &'c mut Container, Ctx, Lang>
where L: Lexer<'inp>, F: ParseInput<'inp, L, O, Ctx, Lang>, Condition: Decision<'inp, L, Ctx::Emitter, W, Lang>, W: Window, Ctx::Emitter: RepeatedEmitter<'inp, O, L, Lang>, Ctx: ParseContext<'inp, L, Lang>, Container: Container<O>, Max: MaxSpec, Min: MinSpec,

Source§

fn parse_input( &mut self, inp: &mut InputRef<'inp, '_, L, Ctx, Lang>, ) -> Result<L::Span, <Ctx::Emitter as Emitter<'inp, L, Lang>>::Error>
where L: Lexer<'inp>, Ctx: ParseContext<'inp, L, Lang>,

Try to parse from the given input.
Source§

fn spanned(self) -> With<PhantomSpan, Self>
where Self: Sized,

Wraps the output of this parser in a Spanned with the span of the parsed input.
Source§

fn sourced(self) -> With<PhantomSliced, Self>
where Self: Sized,

Wraps the output of this parser in a Sliced with the source slice of the parsed input.
Source§

fn located(self) -> With<PhantomLocated, Self>
where Self: Sized,

Wraps the output of this parser in a Located with the span and source slice of the parsed input.
Source§

fn ignored(self) -> Ignore<Self, O>
where Self: Sized,

Ignores the output of this parser.
Source§

fn repeated<Condition, W>( self, condition: Condition, ) -> Repeated<Self, Condition, O, W>
where Self: Sized, L: Lexer<'inp>, Ctx: ParseContext<'inp, L, Lang>, Condition: Decision<'inp, L, Ctx::Emitter, W::CAPACITY>, W: Window,

Creates a Repeated combinator that applies this parser repeatedly until the condition handler Condition returns [RepeatedAction::End] or an fatal error.
Source§

fn separated_by<SepClassifier, Condition, W>( self, sep_classifier: SepClassifier, condition: Condition, ) -> SeparatedBy<Self, SepClassifier, Condition, O, W, L, Ctx>
where Self: Sized, L: Lexer<'inp>, Ctx: ParseContext<'inp, L, Lang>, Condition: Decision<'inp, L, Ctx::Emitter, W, Lang>, SepClassifier: Check<L::Token>, W: Window,

Creates a SeparatedBy combinator that applies this parser repeatedly,
Source§

fn separated_by_comma<Condition, W>( self, condition: Condition, ) -> SeparatedBy<Self, Comma, Condition, O, W, L, Ctx>
where Self: Sized, L: Lexer<'inp>, L::Token: PunctuatorToken<'inp>, Ctx: ParseContext<'inp, L, Lang>, Condition: Decision<'inp, L, Ctx::Emitter, W, Lang>, W: Window,

Creates a SeparatedBy combinator that applies this parser repeatedly,
Source§

fn peek_then<C, W>(self, condition: C) -> PeekThen<Self, C, L::Token, W>
where Self: Sized, L: Lexer<'inp>, Ctx: ParseContext<'inp, L, Lang>, C: FnMut(Peeked<'_, 'inp, L, W>, &mut Ctx::Emitter) -> Result<(), <Ctx::Emitter as Emitter<'inp, L, Lang>>::Error>, W: Window, PeekThen<Self, C, L::Token, W>: ParseInput<'inp, L, O, Ctx, Lang>,

Creates a PeekThen combinator that peeks at most N tokens first from the input before parsing. Read more
Source§

fn peek_then_or_not<C, W>( self, condition: C, ) -> OrNot<PeekThen<Self, C, L::Token, W>>
where Self: Sized, L: Lexer<'inp>, Ctx: ParseContext<'inp, L, Lang>, C: Decision<'inp, L, Ctx::Emitter, W, Lang>, W: Window, OrNot<PeekThen<Self, C, L::Token, W>>: ParseInput<'inp, L, Option<O>, Ctx, Lang>,

Creates a PeekThen combinator that peeks at most N tokens first from the input before parsing. Read more
Source§

fn map<U, F>(self, f: F) -> Map<Self, F, L, Ctx, O, U, Lang>
where Self: Sized, F: FnMut(O) -> U,

Map the output of this parser using the given function.
Source§

fn filter<F>(self, validator: F) -> Filter<Self, F>
where Self: Sized, L: Lexer<'inp>, F: FnMut(&O) -> Result<(), <Ctx::Emitter as Emitter<'inp, L, Lang>>::Error>, Ctx: ParseContext<'inp, L, Lang>,

Filter the output of this parser using a validation function. Read more
Source§

fn filter_map<U, F>(self, mapper: F) -> FilterMap<Self, F, O>
where Self: Sized, L: Lexer<'inp>, F: FnMut(O) -> Result<U, <Ctx::Emitter as Emitter<'inp, L, Lang>>::Error>, Ctx: ParseContext<'inp, L, Lang>,

Filter and map the output of this parser using a validation/transformation function. Read more
Source§

fn validate<F>(self, validator: F) -> Validate<Self, F>
where Self: Sized, L: Lexer<'inp>, F: FnMut(&O) -> Result<(), <Ctx::Emitter as Emitter<'inp, L, Lang>>::Error>, Ctx: ParseContext<'inp, L, Lang>,

Validate the output of this parser with full location context. Read more
Source§

fn then_ignore<G, U>(self, second: G) -> ThenIgnore<Self, G, U>
where Self: Sized, G: ParseInput<'inp, L, U, Ctx, Lang>, Ctx: ParseContext<'inp, L, Lang>,

Sequence this parser with another, ignoring the output of the second.
Source§

fn then<T, U>(self, then: T) -> Then<Self, T>
where Self: Sized, T: ParseInput<'inp, L, U, Ctx, Lang>, Ctx: ParseContext<'inp, L, Lang>,

Sequence this parser with another, using the first result to determine the second parser.
Source§

fn ignore_then<G, U>(self, second: G) -> IgnoreThen<Self, G, O>
where Self: Sized, G: ParseInput<'inp, L, U, Ctx, Lang>,

Sequence this parser with another, ignoring the output of the first.
Source§

fn recover<R>(self, recovery: R) -> Recover<Self, R>
where Self: Sized, R: ParseInput<'inp, L, O, Ctx, Lang>, Ctx: ParseContext<'inp, L, Lang>,

Recover from errors produced by this parser using the given recovery parser.
Source§

fn inplace_recover<R>(self, recovery: R) -> InplaceRecover<Self, R>
where Self: Sized, R: ParseInput<'inp, L, O, Ctx, Lang>, Ctx: ParseContext<'inp, L, Lang>,

Recover in-place from errors produced by this parser using the given recovery parser.
Source§

fn padded(self) -> Padded<Self>
where Self: Sized,

Creates a parser that accepts any token with optional padding.
Source§

impl<'inp, 'c, L, F, SepClassifier, Condition, O, Container, Ctx, Trailing, Leading, Max, Min, Lang: ?Sized, W> ParseInput<'inp, L, <L as Lexer<'inp>>::Span, Ctx, Lang> for Collect<&'c mut SeparatedBy<&'c mut F, &'c mut SepClassifier, Condition, O, W, L, Ctx, &'c mut SeparatedByOptions<Trailing, Leading, Max, Min>, Lang>, &'c mut Container, Ctx, Lang>
where L: Lexer<'inp>, F: ParseInput<'inp, L, O, Ctx, Lang>, Condition: Decision<'inp, L, Ctx::Emitter, W, Lang>, SepClassifier: Check<L::Token>, Ctx::Emitter: SeparatedByEmitter<'inp, O, SepClassifier, L, Lang>, Ctx: ParseContext<'inp, L, Lang>, Container: SeparatorsContainer<Spanned<L::Token, L::Span>, O>, W: Window, Trailing: TrailingSpec, Leading: LeadingSpec, Max: MaxSpec, Min: MinSpec,

Source§

fn parse_input( &mut self, input: &mut InputRef<'inp, '_, L, Ctx, Lang>, ) -> Result<L::Span, <Ctx::Emitter as Emitter<'inp, L, Lang>>::Error>
where L: Lexer<'inp>, Ctx: ParseContext<'inp, L, Lang>,

Try to parse from the given input.
Source§

fn spanned(self) -> With<PhantomSpan, Self>
where Self: Sized,

Wraps the output of this parser in a Spanned with the span of the parsed input.
Source§

fn sourced(self) -> With<PhantomSliced, Self>
where Self: Sized,

Wraps the output of this parser in a Sliced with the source slice of the parsed input.
Source§

fn located(self) -> With<PhantomLocated, Self>
where Self: Sized,

Wraps the output of this parser in a Located with the span and source slice of the parsed input.
Source§

fn ignored(self) -> Ignore<Self, O>
where Self: Sized,

Ignores the output of this parser.
Source§

fn repeated<Condition, W>( self, condition: Condition, ) -> Repeated<Self, Condition, O, W>
where Self: Sized, L: Lexer<'inp>, Ctx: ParseContext<'inp, L, Lang>, Condition: Decision<'inp, L, Ctx::Emitter, W::CAPACITY>, W: Window,

Creates a Repeated combinator that applies this parser repeatedly until the condition handler Condition returns [RepeatedAction::End] or an fatal error.
Source§

fn separated_by<SepClassifier, Condition, W>( self, sep_classifier: SepClassifier, condition: Condition, ) -> SeparatedBy<Self, SepClassifier, Condition, O, W, L, Ctx>
where Self: Sized, L: Lexer<'inp>, Ctx: ParseContext<'inp, L, Lang>, Condition: Decision<'inp, L, Ctx::Emitter, W, Lang>, SepClassifier: Check<L::Token>, W: Window,

Creates a SeparatedBy combinator that applies this parser repeatedly,
Source§

fn separated_by_comma<Condition, W>( self, condition: Condition, ) -> SeparatedBy<Self, Comma, Condition, O, W, L, Ctx>
where Self: Sized, L: Lexer<'inp>, L::Token: PunctuatorToken<'inp>, Ctx: ParseContext<'inp, L, Lang>, Condition: Decision<'inp, L, Ctx::Emitter, W, Lang>, W: Window,

Creates a SeparatedBy combinator that applies this parser repeatedly,
Source§

fn peek_then<C, W>(self, condition: C) -> PeekThen<Self, C, L::Token, W>
where Self: Sized, L: Lexer<'inp>, Ctx: ParseContext<'inp, L, Lang>, C: FnMut(Peeked<'_, 'inp, L, W>, &mut Ctx::Emitter) -> Result<(), <Ctx::Emitter as Emitter<'inp, L, Lang>>::Error>, W: Window, PeekThen<Self, C, L::Token, W>: ParseInput<'inp, L, O, Ctx, Lang>,

Creates a PeekThen combinator that peeks at most N tokens first from the input before parsing. Read more
Source§

fn peek_then_or_not<C, W>( self, condition: C, ) -> OrNot<PeekThen<Self, C, L::Token, W>>
where Self: Sized, L: Lexer<'inp>, Ctx: ParseContext<'inp, L, Lang>, C: Decision<'inp, L, Ctx::Emitter, W, Lang>, W: Window, OrNot<PeekThen<Self, C, L::Token, W>>: ParseInput<'inp, L, Option<O>, Ctx, Lang>,

Creates a PeekThen combinator that peeks at most N tokens first from the input before parsing. Read more
Source§

fn map<U, F>(self, f: F) -> Map<Self, F, L, Ctx, O, U, Lang>
where Self: Sized, F: FnMut(O) -> U,

Map the output of this parser using the given function.
Source§

fn filter<F>(self, validator: F) -> Filter<Self, F>
where Self: Sized, L: Lexer<'inp>, F: FnMut(&O) -> Result<(), <Ctx::Emitter as Emitter<'inp, L, Lang>>::Error>, Ctx: ParseContext<'inp, L, Lang>,

Filter the output of this parser using a validation function. Read more
Source§

fn filter_map<U, F>(self, mapper: F) -> FilterMap<Self, F, O>
where Self: Sized, L: Lexer<'inp>, F: FnMut(O) -> Result<U, <Ctx::Emitter as Emitter<'inp, L, Lang>>::Error>, Ctx: ParseContext<'inp, L, Lang>,

Filter and map the output of this parser using a validation/transformation function. Read more
Source§

fn validate<F>(self, validator: F) -> Validate<Self, F>
where Self: Sized, L: Lexer<'inp>, F: FnMut(&O) -> Result<(), <Ctx::Emitter as Emitter<'inp, L, Lang>>::Error>, Ctx: ParseContext<'inp, L, Lang>,

Validate the output of this parser with full location context. Read more
Source§

fn then_ignore<G, U>(self, second: G) -> ThenIgnore<Self, G, U>
where Self: Sized, G: ParseInput<'inp, L, U, Ctx, Lang>, Ctx: ParseContext<'inp, L, Lang>,

Sequence this parser with another, ignoring the output of the second.
Source§

fn then<T, U>(self, then: T) -> Then<Self, T>
where Self: Sized, T: ParseInput<'inp, L, U, Ctx, Lang>, Ctx: ParseContext<'inp, L, Lang>,

Sequence this parser with another, using the first result to determine the second parser.
Source§

fn ignore_then<G, U>(self, second: G) -> IgnoreThen<Self, G, O>
where Self: Sized, G: ParseInput<'inp, L, U, Ctx, Lang>,

Sequence this parser with another, ignoring the output of the first.
Source§

fn recover<R>(self, recovery: R) -> Recover<Self, R>
where Self: Sized, R: ParseInput<'inp, L, O, Ctx, Lang>, Ctx: ParseContext<'inp, L, Lang>,

Recover from errors produced by this parser using the given recovery parser.
Source§

fn inplace_recover<R>(self, recovery: R) -> InplaceRecover<Self, R>
where Self: Sized, R: ParseInput<'inp, L, O, Ctx, Lang>, Ctx: ParseContext<'inp, L, Lang>,

Recover in-place from errors produced by this parser using the given recovery parser.
Source§

fn padded(self) -> Padded<Self>
where Self: Sized,

Creates a parser that accepts any token with optional padding.
Source§

impl<'inp, 'c, L, F, SepClassifier, Condition, O, Container, Ctx, Trailing, Leading, Max, Min, Lang: ?Sized, W> ParseInput<'inp, L, <L as Lexer<'inp>>::Span, Ctx, Lang> for Collect<SeparatedBy<&'c mut F, &'c mut SepClassifier, &'c mut Condition, O, W, L, Ctx, &'c mut SeparatedByOptions<Trailing, Leading, Max, Min>, Lang>, &'c mut Container, Ctx, Lang>
where L: Lexer<'inp>, F: ParseInput<'inp, L, O, Ctx, Lang>, Condition: Decision<'inp, L, Ctx::Emitter, W, Lang>, SepClassifier: Check<L::Token>, Ctx::Emitter: SeparatedByEmitter<'inp, O, SepClassifier, L, Lang>, Ctx: ParseContext<'inp, L, Lang>, Container: SeparatorsContainer<Spanned<L::Token, L::Span>, O>, W: Window, Trailing: TrailingSpec, Leading: LeadingSpec, Max: MaxSpec, Min: MinSpec,

Source§

fn parse_input( &mut self, inp: &mut InputRef<'inp, '_, L, Ctx, Lang>, ) -> Result<L::Span, <Ctx::Emitter as Emitter<'inp, L, Lang>>::Error>

Try to parse from the given input.
Source§

fn spanned(self) -> With<PhantomSpan, Self>
where Self: Sized,

Wraps the output of this parser in a Spanned with the span of the parsed input.
Source§

fn sourced(self) -> With<PhantomSliced, Self>
where Self: Sized,

Wraps the output of this parser in a Sliced with the source slice of the parsed input.
Source§

fn located(self) -> With<PhantomLocated, Self>
where Self: Sized,

Wraps the output of this parser in a Located with the span and source slice of the parsed input.
Source§

fn ignored(self) -> Ignore<Self, O>
where Self: Sized,

Ignores the output of this parser.
Source§

fn repeated<Condition, W>( self, condition: Condition, ) -> Repeated<Self, Condition, O, W>
where Self: Sized, L: Lexer<'inp>, Ctx: ParseContext<'inp, L, Lang>, Condition: Decision<'inp, L, Ctx::Emitter, W::CAPACITY>, W: Window,

Creates a Repeated combinator that applies this parser repeatedly until the condition handler Condition returns [RepeatedAction::End] or an fatal error.
Source§

fn separated_by<SepClassifier, Condition, W>( self, sep_classifier: SepClassifier, condition: Condition, ) -> SeparatedBy<Self, SepClassifier, Condition, O, W, L, Ctx>
where Self: Sized, L: Lexer<'inp>, Ctx: ParseContext<'inp, L, Lang>, Condition: Decision<'inp, L, Ctx::Emitter, W, Lang>, SepClassifier: Check<L::Token>, W: Window,

Creates a SeparatedBy combinator that applies this parser repeatedly,
Source§

fn separated_by_comma<Condition, W>( self, condition: Condition, ) -> SeparatedBy<Self, Comma, Condition, O, W, L, Ctx>
where Self: Sized, L: Lexer<'inp>, L::Token: PunctuatorToken<'inp>, Ctx: ParseContext<'inp, L, Lang>, Condition: Decision<'inp, L, Ctx::Emitter, W, Lang>, W: Window,

Creates a SeparatedBy combinator that applies this parser repeatedly,
Source§

fn peek_then<C, W>(self, condition: C) -> PeekThen<Self, C, L::Token, W>
where Self: Sized, L: Lexer<'inp>, Ctx: ParseContext<'inp, L, Lang>, C: FnMut(Peeked<'_, 'inp, L, W>, &mut Ctx::Emitter) -> Result<(), <Ctx::Emitter as Emitter<'inp, L, Lang>>::Error>, W: Window, PeekThen<Self, C, L::Token, W>: ParseInput<'inp, L, O, Ctx, Lang>,

Creates a PeekThen combinator that peeks at most N tokens first from the input before parsing. Read more
Source§

fn peek_then_or_not<C, W>( self, condition: C, ) -> OrNot<PeekThen<Self, C, L::Token, W>>
where Self: Sized, L: Lexer<'inp>, Ctx: ParseContext<'inp, L, Lang>, C: Decision<'inp, L, Ctx::Emitter, W, Lang>, W: Window, OrNot<PeekThen<Self, C, L::Token, W>>: ParseInput<'inp, L, Option<O>, Ctx, Lang>,

Creates a PeekThen combinator that peeks at most N tokens first from the input before parsing. Read more
Source§

fn map<U, F>(self, f: F) -> Map<Self, F, L, Ctx, O, U, Lang>
where Self: Sized, F: FnMut(O) -> U,

Map the output of this parser using the given function.
Source§

fn filter<F>(self, validator: F) -> Filter<Self, F>
where Self: Sized, L: Lexer<'inp>, F: FnMut(&O) -> Result<(), <Ctx::Emitter as Emitter<'inp, L, Lang>>::Error>, Ctx: ParseContext<'inp, L, Lang>,

Filter the output of this parser using a validation function. Read more
Source§

fn filter_map<U, F>(self, mapper: F) -> FilterMap<Self, F, O>
where Self: Sized, L: Lexer<'inp>, F: FnMut(O) -> Result<U, <Ctx::Emitter as Emitter<'inp, L, Lang>>::Error>, Ctx: ParseContext<'inp, L, Lang>,

Filter and map the output of this parser using a validation/transformation function. Read more
Source§

fn validate<F>(self, validator: F) -> Validate<Self, F>
where Self: Sized, L: Lexer<'inp>, F: FnMut(&O) -> Result<(), <Ctx::Emitter as Emitter<'inp, L, Lang>>::Error>, Ctx: ParseContext<'inp, L, Lang>,

Validate the output of this parser with full location context. Read more
Source§

fn then_ignore<G, U>(self, second: G) -> ThenIgnore<Self, G, U>
where Self: Sized, G: ParseInput<'inp, L, U, Ctx, Lang>, Ctx: ParseContext<'inp, L, Lang>,

Sequence this parser with another, ignoring the output of the second.
Source§

fn then<T, U>(self, then: T) -> Then<Self, T>
where Self: Sized, T: ParseInput<'inp, L, U, Ctx, Lang>, Ctx: ParseContext<'inp, L, Lang>,

Sequence this parser with another, using the first result to determine the second parser.
Source§

fn ignore_then<G, U>(self, second: G) -> IgnoreThen<Self, G, O>
where Self: Sized, G: ParseInput<'inp, L, U, Ctx, Lang>,

Sequence this parser with another, ignoring the output of the first.
Source§

fn recover<R>(self, recovery: R) -> Recover<Self, R>
where Self: Sized, R: ParseInput<'inp, L, O, Ctx, Lang>, Ctx: ParseContext<'inp, L, Lang>,

Recover from errors produced by this parser using the given recovery parser.
Source§

fn inplace_recover<R>(self, recovery: R) -> InplaceRecover<Self, R>
where Self: Sized, R: ParseInput<'inp, L, O, Ctx, Lang>, Ctx: ParseContext<'inp, L, Lang>,

Recover in-place from errors produced by this parser using the given recovery parser.
Source§

fn padded(self) -> Padded<Self>
where Self: Sized,

Creates a parser that accepts any token with optional padding.
Source§

impl<'inp, L, P, Open, Close, O, Condition, Container, Ctx, Delim, W, Max, Min, Lang: ?Sized> ParseInput<'inp, L, Container, Ctx, Lang> for Collect<DelimitedBy<P, Condition, Open, Close, Delim, O, W, RepeatedOptions<Max, Min>>, Container, Ctx, Lang>
where Open: Check<L::Token, Result<(), <L::Token as Token<'inp>>::Kind>>, Close: Check<L::Token, Result<(), <L::Token as Token<'inp>>::Kind>>, Delim: Clone, L: Lexer<'inp>, P: ParseInput<'inp, L, O, Ctx, Lang>, Condition: Decision<'inp, L, Ctx::Emitter, W, Lang>, W: Window, Ctx::Emitter: DelimiterEmitter<'inp, Delim, L, Lang> + RepeatedEmitter<'inp, O, L, Lang>, Ctx: ParseContext<'inp, L, Lang>, <Ctx::Emitter as Emitter<'inp, L, Lang>>::Error: From<UnexpectedEot<L::Offset, Lang>>, Container: Default + DelimiterContainer<Spanned<L::Token, L::Span>, Spanned<L::Token, L::Span>, O>, Max: MaxSpec, Min: MinSpec,

Source§

fn parse_input( &mut self, inp: &mut InputRef<'inp, '_, L, Ctx, Lang>, ) -> Result<Container, <Ctx::Emitter as Emitter<'inp, L, Lang>>::Error>
where L: Lexer<'inp>, Ctx: ParseContext<'inp, L, Lang>,

Try to parse from the given input.
Source§

fn spanned(self) -> With<PhantomSpan, Self>
where Self: Sized,

Wraps the output of this parser in a Spanned with the span of the parsed input.
Source§

fn sourced(self) -> With<PhantomSliced, Self>
where Self: Sized,

Wraps the output of this parser in a Sliced with the source slice of the parsed input.
Source§

fn located(self) -> With<PhantomLocated, Self>
where Self: Sized,

Wraps the output of this parser in a Located with the span and source slice of the parsed input.
Source§

fn ignored(self) -> Ignore<Self, O>
where Self: Sized,

Ignores the output of this parser.
Source§

fn repeated<Condition, W>( self, condition: Condition, ) -> Repeated<Self, Condition, O, W>
where Self: Sized, L: Lexer<'inp>, Ctx: ParseContext<'inp, L, Lang>, Condition: Decision<'inp, L, Ctx::Emitter, W::CAPACITY>, W: Window,

Creates a Repeated combinator that applies this parser repeatedly until the condition handler Condition returns [RepeatedAction::End] or an fatal error.
Source§

fn separated_by<SepClassifier, Condition, W>( self, sep_classifier: SepClassifier, condition: Condition, ) -> SeparatedBy<Self, SepClassifier, Condition, O, W, L, Ctx>
where Self: Sized, L: Lexer<'inp>, Ctx: ParseContext<'inp, L, Lang>, Condition: Decision<'inp, L, Ctx::Emitter, W, Lang>, SepClassifier: Check<L::Token>, W: Window,

Creates a SeparatedBy combinator that applies this parser repeatedly,
Source§

fn separated_by_comma<Condition, W>( self, condition: Condition, ) -> SeparatedBy<Self, Comma, Condition, O, W, L, Ctx>
where Self: Sized, L: Lexer<'inp>, L::Token: PunctuatorToken<'inp>, Ctx: ParseContext<'inp, L, Lang>, Condition: Decision<'inp, L, Ctx::Emitter, W, Lang>, W: Window,

Creates a SeparatedBy combinator that applies this parser repeatedly,
Source§

fn peek_then<C, W>(self, condition: C) -> PeekThen<Self, C, L::Token, W>
where Self: Sized, L: Lexer<'inp>, Ctx: ParseContext<'inp, L, Lang>, C: FnMut(Peeked<'_, 'inp, L, W>, &mut Ctx::Emitter) -> Result<(), <Ctx::Emitter as Emitter<'inp, L, Lang>>::Error>, W: Window, PeekThen<Self, C, L::Token, W>: ParseInput<'inp, L, O, Ctx, Lang>,

Creates a PeekThen combinator that peeks at most N tokens first from the input before parsing. Read more
Source§

fn peek_then_or_not<C, W>( self, condition: C, ) -> OrNot<PeekThen<Self, C, L::Token, W>>
where Self: Sized, L: Lexer<'inp>, Ctx: ParseContext<'inp, L, Lang>, C: Decision<'inp, L, Ctx::Emitter, W, Lang>, W: Window, OrNot<PeekThen<Self, C, L::Token, W>>: ParseInput<'inp, L, Option<O>, Ctx, Lang>,

Creates a PeekThen combinator that peeks at most N tokens first from the input before parsing. Read more
Source§

fn map<U, F>(self, f: F) -> Map<Self, F, L, Ctx, O, U, Lang>
where Self: Sized, F: FnMut(O) -> U,

Map the output of this parser using the given function.
Source§

fn filter<F>(self, validator: F) -> Filter<Self, F>
where Self: Sized, L: Lexer<'inp>, F: FnMut(&O) -> Result<(), <Ctx::Emitter as Emitter<'inp, L, Lang>>::Error>, Ctx: ParseContext<'inp, L, Lang>,

Filter the output of this parser using a validation function. Read more
Source§

fn filter_map<U, F>(self, mapper: F) -> FilterMap<Self, F, O>
where Self: Sized, L: Lexer<'inp>, F: FnMut(O) -> Result<U, <Ctx::Emitter as Emitter<'inp, L, Lang>>::Error>, Ctx: ParseContext<'inp, L, Lang>,

Filter and map the output of this parser using a validation/transformation function. Read more
Source§

fn validate<F>(self, validator: F) -> Validate<Self, F>
where Self: Sized, L: Lexer<'inp>, F: FnMut(&O) -> Result<(), <Ctx::Emitter as Emitter<'inp, L, Lang>>::Error>, Ctx: ParseContext<'inp, L, Lang>,

Validate the output of this parser with full location context. Read more
Source§

fn then_ignore<G, U>(self, second: G) -> ThenIgnore<Self, G, U>
where Self: Sized, G: ParseInput<'inp, L, U, Ctx, Lang>, Ctx: ParseContext<'inp, L, Lang>,

Sequence this parser with another, ignoring the output of the second.
Source§

fn then<T, U>(self, then: T) -> Then<Self, T>
where Self: Sized, T: ParseInput<'inp, L, U, Ctx, Lang>, Ctx: ParseContext<'inp, L, Lang>,

Sequence this parser with another, using the first result to determine the second parser.
Source§

fn ignore_then<G, U>(self, second: G) -> IgnoreThen<Self, G, O>
where Self: Sized, G: ParseInput<'inp, L, U, Ctx, Lang>,

Sequence this parser with another, ignoring the output of the first.
Source§

fn recover<R>(self, recovery: R) -> Recover<Self, R>
where Self: Sized, R: ParseInput<'inp, L, O, Ctx, Lang>, Ctx: ParseContext<'inp, L, Lang>,

Recover from errors produced by this parser using the given recovery parser.
Source§

fn inplace_recover<R>(self, recovery: R) -> InplaceRecover<Self, R>
where Self: Sized, R: ParseInput<'inp, L, O, Ctx, Lang>, Ctx: ParseContext<'inp, L, Lang>,

Recover in-place from errors produced by this parser using the given recovery parser.
Source§

fn padded(self) -> Padded<Self>
where Self: Sized,

Creates a parser that accepts any token with optional padding.
Source§

impl<'inp, L, P, SepClassifier, Condition, O, Container, Ctx, Open, Close, Delim, Trailing, Leading, Max, Min, Lang: ?Sized, W> ParseInput<'inp, L, Container, Ctx, Lang> for Collect<DelimitedSeparatedBy<P, SepClassifier, Condition, Open, Close, Delim, O, W, L, Ctx, SeparatedByOptions<Trailing, Leading, Max, Min>, Lang>, Container, Ctx, Lang>
where L: Lexer<'inp>, P: ParseInput<'inp, L, O, Ctx, Lang>, Delim: Clone, Open: Check<L::Token, Result<(), <L::Token as Token<'inp>>::Kind>>, Close: Check<L::Token, Result<(), <L::Token as Token<'inp>>::Kind>>, Condition: Decision<'inp, L, Ctx::Emitter, W, Lang>, SepClassifier: Check<L::Token>, Ctx::Emitter: SeparatedByEmitter<'inp, O, SepClassifier, L, Lang> + DelimiterEmitter<'inp, Delim, L, Lang>, Ctx: ParseContext<'inp, L, Lang>, <Ctx::Emitter as Emitter<'inp, L, Lang>>::Error: From<UnexpectedEot<L::Offset, Lang>>, Container: Default + DelimiterContainer<Spanned<L::Token, L::Span>, Spanned<L::Token, L::Span>, O> + SeparatorsContainer<Spanned<L::Token, L::Span>, O>, W: Window, Trailing: TrailingSpec, Leading: LeadingSpec, Max: MaxSpec, Min: MinSpec,

Source§

fn parse_input( &mut self, inp: &mut InputRef<'inp, '_, L, Ctx, Lang>, ) -> Result<Container, <Ctx::Emitter as Emitter<'inp, L, Lang>>::Error>
where L: Lexer<'inp>, Ctx: ParseContext<'inp, L, Lang>,

Try to parse from the given input.
Source§

fn spanned(self) -> With<PhantomSpan, Self>
where Self: Sized,

Wraps the output of this parser in a Spanned with the span of the parsed input.
Source§

fn sourced(self) -> With<PhantomSliced, Self>
where Self: Sized,

Wraps the output of this parser in a Sliced with the source slice of the parsed input.
Source§

fn located(self) -> With<PhantomLocated, Self>
where Self: Sized,

Wraps the output of this parser in a Located with the span and source slice of the parsed input.
Source§

fn ignored(self) -> Ignore<Self, O>
where Self: Sized,

Ignores the output of this parser.
Source§

fn repeated<Condition, W>( self, condition: Condition, ) -> Repeated<Self, Condition, O, W>
where Self: Sized, L: Lexer<'inp>, Ctx: ParseContext<'inp, L, Lang>, Condition: Decision<'inp, L, Ctx::Emitter, W::CAPACITY>, W: Window,

Creates a Repeated combinator that applies this parser repeatedly until the condition handler Condition returns [RepeatedAction::End] or an fatal error.
Source§

fn separated_by<SepClassifier, Condition, W>( self, sep_classifier: SepClassifier, condition: Condition, ) -> SeparatedBy<Self, SepClassifier, Condition, O, W, L, Ctx>
where Self: Sized, L: Lexer<'inp>, Ctx: ParseContext<'inp, L, Lang>, Condition: Decision<'inp, L, Ctx::Emitter, W, Lang>, SepClassifier: Check<L::Token>, W: Window,

Creates a SeparatedBy combinator that applies this parser repeatedly,
Source§

fn separated_by_comma<Condition, W>( self, condition: Condition, ) -> SeparatedBy<Self, Comma, Condition, O, W, L, Ctx>
where Self: Sized, L: Lexer<'inp>, L::Token: PunctuatorToken<'inp>, Ctx: ParseContext<'inp, L, Lang>, Condition: Decision<'inp, L, Ctx::Emitter, W, Lang>, W: Window,

Creates a SeparatedBy combinator that applies this parser repeatedly,
Source§

fn peek_then<C, W>(self, condition: C) -> PeekThen<Self, C, L::Token, W>
where Self: Sized, L: Lexer<'inp>, Ctx: ParseContext<'inp, L, Lang>, C: FnMut(Peeked<'_, 'inp, L, W>, &mut Ctx::Emitter) -> Result<(), <Ctx::Emitter as Emitter<'inp, L, Lang>>::Error>, W: Window, PeekThen<Self, C, L::Token, W>: ParseInput<'inp, L, O, Ctx, Lang>,

Creates a PeekThen combinator that peeks at most N tokens first from the input before parsing. Read more
Source§

fn peek_then_or_not<C, W>( self, condition: C, ) -> OrNot<PeekThen<Self, C, L::Token, W>>
where Self: Sized, L: Lexer<'inp>, Ctx: ParseContext<'inp, L, Lang>, C: Decision<'inp, L, Ctx::Emitter, W, Lang>, W: Window, OrNot<PeekThen<Self, C, L::Token, W>>: ParseInput<'inp, L, Option<O>, Ctx, Lang>,

Creates a PeekThen combinator that peeks at most N tokens first from the input before parsing. Read more
Source§

fn map<U, F>(self, f: F) -> Map<Self, F, L, Ctx, O, U, Lang>
where Self: Sized, F: FnMut(O) -> U,

Map the output of this parser using the given function.
Source§

fn filter<F>(self, validator: F) -> Filter<Self, F>
where Self: Sized, L: Lexer<'inp>, F: FnMut(&O) -> Result<(), <Ctx::Emitter as Emitter<'inp, L, Lang>>::Error>, Ctx: ParseContext<'inp, L, Lang>,

Filter the output of this parser using a validation function. Read more
Source§

fn filter_map<U, F>(self, mapper: F) -> FilterMap<Self, F, O>
where Self: Sized, L: Lexer<'inp>, F: FnMut(O) -> Result<U, <Ctx::Emitter as Emitter<'inp, L, Lang>>::Error>, Ctx: ParseContext<'inp, L, Lang>,

Filter and map the output of this parser using a validation/transformation function. Read more
Source§

fn validate<F>(self, validator: F) -> Validate<Self, F>
where Self: Sized, L: Lexer<'inp>, F: FnMut(&O) -> Result<(), <Ctx::Emitter as Emitter<'inp, L, Lang>>::Error>, Ctx: ParseContext<'inp, L, Lang>,

Validate the output of this parser with full location context. Read more
Source§

fn then_ignore<G, U>(self, second: G) -> ThenIgnore<Self, G, U>
where Self: Sized, G: ParseInput<'inp, L, U, Ctx, Lang>, Ctx: ParseContext<'inp, L, Lang>,

Sequence this parser with another, ignoring the output of the second.
Source§

fn then<T, U>(self, then: T) -> Then<Self, T>
where Self: Sized, T: ParseInput<'inp, L, U, Ctx, Lang>, Ctx: ParseContext<'inp, L, Lang>,

Sequence this parser with another, using the first result to determine the second parser.
Source§

fn ignore_then<G, U>(self, second: G) -> IgnoreThen<Self, G, O>
where Self: Sized, G: ParseInput<'inp, L, U, Ctx, Lang>,

Sequence this parser with another, ignoring the output of the first.
Source§

fn recover<R>(self, recovery: R) -> Recover<Self, R>
where Self: Sized, R: ParseInput<'inp, L, O, Ctx, Lang>, Ctx: ParseContext<'inp, L, Lang>,

Recover from errors produced by this parser using the given recovery parser.
Source§

fn inplace_recover<R>(self, recovery: R) -> InplaceRecover<Self, R>
where Self: Sized, R: ParseInput<'inp, L, O, Ctx, Lang>, Ctx: ParseContext<'inp, L, Lang>,

Recover in-place from errors produced by this parser using the given recovery parser.
Source§

fn padded(self) -> Padded<Self>
where Self: Sized,

Creates a parser that accepts any token with optional padding.
Source§

impl<'inp, L, F, Condition, O, Container, Ctx, Max, Min, Lang: ?Sized, W> ParseInput<'inp, L, Container, Ctx, Lang> for Collect<Repeated<F, Condition, O, W, RepeatedOptions<Max, Min>>, Container, Ctx, Lang>
where L: Lexer<'inp>, F: ParseInput<'inp, L, O, Ctx, Lang>, Condition: Decision<'inp, L, Ctx::Emitter, W, Lang>, W: Window, Ctx::Emitter: RepeatedEmitter<'inp, O, L, Lang>, Ctx: ParseContext<'inp, L, Lang>, Container: Default + Container<O>, Max: MaxSpec, Min: MinSpec,

Source§

fn parse_input( &mut self, inp: &mut InputRef<'inp, '_, L, Ctx, Lang>, ) -> Result<Container, <Ctx::Emitter as Emitter<'inp, L, Lang>>::Error>
where L: Lexer<'inp>, Ctx: ParseContext<'inp, L, Lang>,

Try to parse from the given input.
Source§

fn spanned(self) -> With<PhantomSpan, Self>
where Self: Sized,

Wraps the output of this parser in a Spanned with the span of the parsed input.
Source§

fn sourced(self) -> With<PhantomSliced, Self>
where Self: Sized,

Wraps the output of this parser in a Sliced with the source slice of the parsed input.
Source§

fn located(self) -> With<PhantomLocated, Self>
where Self: Sized,

Wraps the output of this parser in a Located with the span and source slice of the parsed input.
Source§

fn ignored(self) -> Ignore<Self, O>
where Self: Sized,

Ignores the output of this parser.
Source§

fn repeated<Condition, W>( self, condition: Condition, ) -> Repeated<Self, Condition, O, W>
where Self: Sized, L: Lexer<'inp>, Ctx: ParseContext<'inp, L, Lang>, Condition: Decision<'inp, L, Ctx::Emitter, W::CAPACITY>, W: Window,

Creates a Repeated combinator that applies this parser repeatedly until the condition handler Condition returns [RepeatedAction::End] or an fatal error.
Source§

fn separated_by<SepClassifier, Condition, W>( self, sep_classifier: SepClassifier, condition: Condition, ) -> SeparatedBy<Self, SepClassifier, Condition, O, W, L, Ctx>
where Self: Sized, L: Lexer<'inp>, Ctx: ParseContext<'inp, L, Lang>, Condition: Decision<'inp, L, Ctx::Emitter, W, Lang>, SepClassifier: Check<L::Token>, W: Window,

Creates a SeparatedBy combinator that applies this parser repeatedly,
Source§

fn separated_by_comma<Condition, W>( self, condition: Condition, ) -> SeparatedBy<Self, Comma, Condition, O, W, L, Ctx>
where Self: Sized, L: Lexer<'inp>, L::Token: PunctuatorToken<'inp>, Ctx: ParseContext<'inp, L, Lang>, Condition: Decision<'inp, L, Ctx::Emitter, W, Lang>, W: Window,

Creates a SeparatedBy combinator that applies this parser repeatedly,
Source§

fn peek_then<C, W>(self, condition: C) -> PeekThen<Self, C, L::Token, W>
where Self: Sized, L: Lexer<'inp>, Ctx: ParseContext<'inp, L, Lang>, C: FnMut(Peeked<'_, 'inp, L, W>, &mut Ctx::Emitter) -> Result<(), <Ctx::Emitter as Emitter<'inp, L, Lang>>::Error>, W: Window, PeekThen<Self, C, L::Token, W>: ParseInput<'inp, L, O, Ctx, Lang>,

Creates a PeekThen combinator that peeks at most N tokens first from the input before parsing. Read more
Source§

fn peek_then_or_not<C, W>( self, condition: C, ) -> OrNot<PeekThen<Self, C, L::Token, W>>
where Self: Sized, L: Lexer<'inp>, Ctx: ParseContext<'inp, L, Lang>, C: Decision<'inp, L, Ctx::Emitter, W, Lang>, W: Window, OrNot<PeekThen<Self, C, L::Token, W>>: ParseInput<'inp, L, Option<O>, Ctx, Lang>,

Creates a PeekThen combinator that peeks at most N tokens first from the input before parsing. Read more
Source§

fn map<U, F>(self, f: F) -> Map<Self, F, L, Ctx, O, U, Lang>
where Self: Sized, F: FnMut(O) -> U,

Map the output of this parser using the given function.
Source§

fn filter<F>(self, validator: F) -> Filter<Self, F>
where Self: Sized, L: Lexer<'inp>, F: FnMut(&O) -> Result<(), <Ctx::Emitter as Emitter<'inp, L, Lang>>::Error>, Ctx: ParseContext<'inp, L, Lang>,

Filter the output of this parser using a validation function. Read more
Source§

fn filter_map<U, F>(self, mapper: F) -> FilterMap<Self, F, O>
where Self: Sized, L: Lexer<'inp>, F: FnMut(O) -> Result<U, <Ctx::Emitter as Emitter<'inp, L, Lang>>::Error>, Ctx: ParseContext<'inp, L, Lang>,

Filter and map the output of this parser using a validation/transformation function. Read more
Source§

fn validate<F>(self, validator: F) -> Validate<Self, F>
where Self: Sized, L: Lexer<'inp>, F: FnMut(&O) -> Result<(), <Ctx::Emitter as Emitter<'inp, L, Lang>>::Error>, Ctx: ParseContext<'inp, L, Lang>,

Validate the output of this parser with full location context. Read more
Source§

fn then_ignore<G, U>(self, second: G) -> ThenIgnore<Self, G, U>
where Self: Sized, G: ParseInput<'inp, L, U, Ctx, Lang>, Ctx: ParseContext<'inp, L, Lang>,

Sequence this parser with another, ignoring the output of the second.
Source§

fn then<T, U>(self, then: T) -> Then<Self, T>
where Self: Sized, T: ParseInput<'inp, L, U, Ctx, Lang>, Ctx: ParseContext<'inp, L, Lang>,

Sequence this parser with another, using the first result to determine the second parser.
Source§

fn ignore_then<G, U>(self, second: G) -> IgnoreThen<Self, G, O>
where Self: Sized, G: ParseInput<'inp, L, U, Ctx, Lang>,

Sequence this parser with another, ignoring the output of the first.
Source§

fn recover<R>(self, recovery: R) -> Recover<Self, R>
where Self: Sized, R: ParseInput<'inp, L, O, Ctx, Lang>, Ctx: ParseContext<'inp, L, Lang>,

Recover from errors produced by this parser using the given recovery parser.
Source§

fn inplace_recover<R>(self, recovery: R) -> InplaceRecover<Self, R>
where Self: Sized, R: ParseInput<'inp, L, O, Ctx, Lang>, Ctx: ParseContext<'inp, L, Lang>,

Recover in-place from errors produced by this parser using the given recovery parser.
Source§

fn padded(self) -> Padded<Self>
where Self: Sized,

Creates a parser that accepts any token with optional padding.
Source§

impl<'inp, L, F, SepClassifier, Condition, O, Container, Ctx, Trailing, Leading, Max, Min, Lang: ?Sized, W> ParseInput<'inp, L, Container, Ctx, Lang> for Collect<SeparatedBy<F, SepClassifier, Condition, O, W, L, Ctx, SeparatedByOptions<Trailing, Leading, Max, Min>, Lang>, Container, Ctx, Lang>
where L: Lexer<'inp>, F: ParseInput<'inp, L, O, Ctx, Lang>, Condition: Decision<'inp, L, Ctx::Emitter, W, Lang>, SepClassifier: Check<L::Token>, Ctx::Emitter: SeparatedByEmitter<'inp, O, SepClassifier, L, Lang>, Ctx: ParseContext<'inp, L, Lang>, Container: Default + SeparatorsContainer<Spanned<L::Token, L::Span>, O>, W: Window, Trailing: TrailingSpec, Leading: LeadingSpec, Max: MaxSpec, Min: MinSpec,

Source§

fn parse_input( &mut self, inp: &mut InputRef<'inp, '_, L, Ctx, Lang>, ) -> Result<Container, <Ctx::Emitter as Emitter<'inp, L, Lang>>::Error>

Try to parse from the given input.
Source§

fn spanned(self) -> With<PhantomSpan, Self>
where Self: Sized,

Wraps the output of this parser in a Spanned with the span of the parsed input.
Source§

fn sourced(self) -> With<PhantomSliced, Self>
where Self: Sized,

Wraps the output of this parser in a Sliced with the source slice of the parsed input.
Source§

fn located(self) -> With<PhantomLocated, Self>
where Self: Sized,

Wraps the output of this parser in a Located with the span and source slice of the parsed input.
Source§

fn ignored(self) -> Ignore<Self, O>
where Self: Sized,

Ignores the output of this parser.
Source§

fn repeated<Condition, W>( self, condition: Condition, ) -> Repeated<Self, Condition, O, W>
where Self: Sized, L: Lexer<'inp>, Ctx: ParseContext<'inp, L, Lang>, Condition: Decision<'inp, L, Ctx::Emitter, W::CAPACITY>, W: Window,

Creates a Repeated combinator that applies this parser repeatedly until the condition handler Condition returns [RepeatedAction::End] or an fatal error.
Source§

fn separated_by<SepClassifier, Condition, W>( self, sep_classifier: SepClassifier, condition: Condition, ) -> SeparatedBy<Self, SepClassifier, Condition, O, W, L, Ctx>
where Self: Sized, L: Lexer<'inp>, Ctx: ParseContext<'inp, L, Lang>, Condition: Decision<'inp, L, Ctx::Emitter, W, Lang>, SepClassifier: Check<L::Token>, W: Window,

Creates a SeparatedBy combinator that applies this parser repeatedly,
Source§

fn separated_by_comma<Condition, W>( self, condition: Condition, ) -> SeparatedBy<Self, Comma, Condition, O, W, L, Ctx>
where Self: Sized, L: Lexer<'inp>, L::Token: PunctuatorToken<'inp>, Ctx: ParseContext<'inp, L, Lang>, Condition: Decision<'inp, L, Ctx::Emitter, W, Lang>, W: Window,

Creates a SeparatedBy combinator that applies this parser repeatedly,
Source§

fn peek_then<C, W>(self, condition: C) -> PeekThen<Self, C, L::Token, W>
where Self: Sized, L: Lexer<'inp>, Ctx: ParseContext<'inp, L, Lang>, C: FnMut(Peeked<'_, 'inp, L, W>, &mut Ctx::Emitter) -> Result<(), <Ctx::Emitter as Emitter<'inp, L, Lang>>::Error>, W: Window, PeekThen<Self, C, L::Token, W>: ParseInput<'inp, L, O, Ctx, Lang>,

Creates a PeekThen combinator that peeks at most N tokens first from the input before parsing. Read more
Source§

fn peek_then_or_not<C, W>( self, condition: C, ) -> OrNot<PeekThen<Self, C, L::Token, W>>
where Self: Sized, L: Lexer<'inp>, Ctx: ParseContext<'inp, L, Lang>, C: Decision<'inp, L, Ctx::Emitter, W, Lang>, W: Window, OrNot<PeekThen<Self, C, L::Token, W>>: ParseInput<'inp, L, Option<O>, Ctx, Lang>,

Creates a PeekThen combinator that peeks at most N tokens first from the input before parsing. Read more
Source§

fn map<U, F>(self, f: F) -> Map<Self, F, L, Ctx, O, U, Lang>
where Self: Sized, F: FnMut(O) -> U,

Map the output of this parser using the given function.
Source§

fn filter<F>(self, validator: F) -> Filter<Self, F>
where Self: Sized, L: Lexer<'inp>, F: FnMut(&O) -> Result<(), <Ctx::Emitter as Emitter<'inp, L, Lang>>::Error>, Ctx: ParseContext<'inp, L, Lang>,

Filter the output of this parser using a validation function. Read more
Source§

fn filter_map<U, F>(self, mapper: F) -> FilterMap<Self, F, O>
where Self: Sized, L: Lexer<'inp>, F: FnMut(O) -> Result<U, <Ctx::Emitter as Emitter<'inp, L, Lang>>::Error>, Ctx: ParseContext<'inp, L, Lang>,

Filter and map the output of this parser using a validation/transformation function. Read more
Source§

fn validate<F>(self, validator: F) -> Validate<Self, F>
where Self: Sized, L: Lexer<'inp>, F: FnMut(&O) -> Result<(), <Ctx::Emitter as Emitter<'inp, L, Lang>>::Error>, Ctx: ParseContext<'inp, L, Lang>,

Validate the output of this parser with full location context. Read more
Source§

fn then_ignore<G, U>(self, second: G) -> ThenIgnore<Self, G, U>
where Self: Sized, G: ParseInput<'inp, L, U, Ctx, Lang>, Ctx: ParseContext<'inp, L, Lang>,

Sequence this parser with another, ignoring the output of the second.
Source§

fn then<T, U>(self, then: T) -> Then<Self, T>
where Self: Sized, T: ParseInput<'inp, L, U, Ctx, Lang>, Ctx: ParseContext<'inp, L, Lang>,

Sequence this parser with another, using the first result to determine the second parser.
Source§

fn ignore_then<G, U>(self, second: G) -> IgnoreThen<Self, G, O>
where Self: Sized, G: ParseInput<'inp, L, U, Ctx, Lang>,

Sequence this parser with another, ignoring the output of the first.
Source§

fn recover<R>(self, recovery: R) -> Recover<Self, R>
where Self: Sized, R: ParseInput<'inp, L, O, Ctx, Lang>, Ctx: ParseContext<'inp, L, Lang>,

Recover from errors produced by this parser using the given recovery parser.
Source§

fn inplace_recover<R>(self, recovery: R) -> InplaceRecover<Self, R>
where Self: Sized, R: ParseInput<'inp, L, O, Ctx, Lang>, Ctx: ParseContext<'inp, L, Lang>,

Recover in-place from errors produced by this parser using the given recovery parser.
Source§

fn padded(self) -> Padded<Self>
where Self: Sized,

Creates a parser that accepts any token with optional padding.
Source§

impl<'inp, L, F, Condition, O, Container, Ctx, Max, Min, Lang: ?Sized, W> ParseInput<'inp, L, Spanned<Container, <L as Lexer<'inp>>::Span>, Ctx, Lang> for Collect<Repeated<F, Condition, O, W, RepeatedOptions<Max, Min>>, Container, Ctx, Lang>
where L: Lexer<'inp>, F: ParseInput<'inp, L, O, Ctx, Lang>, Condition: Decision<'inp, L, Ctx::Emitter, W, Lang>, W: Window, Ctx::Emitter: RepeatedEmitter<'inp, O, L, Lang>, Ctx: ParseContext<'inp, L, Lang>, Container: Default + Container<O>, Max: MaxSpec, Min: MinSpec,

Source§

fn parse_input( &mut self, inp: &mut InputRef<'inp, '_, L, Ctx, Lang>, ) -> Result<Spanned<Container, L::Span>, <Ctx::Emitter as Emitter<'inp, L, Lang>>::Error>
where L: Lexer<'inp>, Ctx: ParseContext<'inp, L, Lang>,

Try to parse from the given input.
Source§

fn spanned(self) -> With<PhantomSpan, Self>
where Self: Sized,

Wraps the output of this parser in a Spanned with the span of the parsed input.
Source§

fn sourced(self) -> With<PhantomSliced, Self>
where Self: Sized,

Wraps the output of this parser in a Sliced with the source slice of the parsed input.
Source§

fn located(self) -> With<PhantomLocated, Self>
where Self: Sized,

Wraps the output of this parser in a Located with the span and source slice of the parsed input.
Source§

fn ignored(self) -> Ignore<Self, O>
where Self: Sized,

Ignores the output of this parser.
Source§

fn repeated<Condition, W>( self, condition: Condition, ) -> Repeated<Self, Condition, O, W>
where Self: Sized, L: Lexer<'inp>, Ctx: ParseContext<'inp, L, Lang>, Condition: Decision<'inp, L, Ctx::Emitter, W::CAPACITY>, W: Window,

Creates a Repeated combinator that applies this parser repeatedly until the condition handler Condition returns [RepeatedAction::End] or an fatal error.
Source§

fn separated_by<SepClassifier, Condition, W>( self, sep_classifier: SepClassifier, condition: Condition, ) -> SeparatedBy<Self, SepClassifier, Condition, O, W, L, Ctx>
where Self: Sized, L: Lexer<'inp>, Ctx: ParseContext<'inp, L, Lang>, Condition: Decision<'inp, L, Ctx::Emitter, W, Lang>, SepClassifier: Check<L::Token>, W: Window,

Creates a SeparatedBy combinator that applies this parser repeatedly,
Source§

fn separated_by_comma<Condition, W>( self, condition: Condition, ) -> SeparatedBy<Self, Comma, Condition, O, W, L, Ctx>
where Self: Sized, L: Lexer<'inp>, L::Token: PunctuatorToken<'inp>, Ctx: ParseContext<'inp, L, Lang>, Condition: Decision<'inp, L, Ctx::Emitter, W, Lang>, W: Window,

Creates a SeparatedBy combinator that applies this parser repeatedly,
Source§

fn peek_then<C, W>(self, condition: C) -> PeekThen<Self, C, L::Token, W>
where Self: Sized, L: Lexer<'inp>, Ctx: ParseContext<'inp, L, Lang>, C: FnMut(Peeked<'_, 'inp, L, W>, &mut Ctx::Emitter) -> Result<(), <Ctx::Emitter as Emitter<'inp, L, Lang>>::Error>, W: Window, PeekThen<Self, C, L::Token, W>: ParseInput<'inp, L, O, Ctx, Lang>,

Creates a PeekThen combinator that peeks at most N tokens first from the input before parsing. Read more
Source§

fn peek_then_or_not<C, W>( self, condition: C, ) -> OrNot<PeekThen<Self, C, L::Token, W>>
where Self: Sized, L: Lexer<'inp>, Ctx: ParseContext<'inp, L, Lang>, C: Decision<'inp, L, Ctx::Emitter, W, Lang>, W: Window, OrNot<PeekThen<Self, C, L::Token, W>>: ParseInput<'inp, L, Option<O>, Ctx, Lang>,

Creates a PeekThen combinator that peeks at most N tokens first from the input before parsing. Read more
Source§

fn map<U, F>(self, f: F) -> Map<Self, F, L, Ctx, O, U, Lang>
where Self: Sized, F: FnMut(O) -> U,

Map the output of this parser using the given function.
Source§

fn filter<F>(self, validator: F) -> Filter<Self, F>
where Self: Sized, L: Lexer<'inp>, F: FnMut(&O) -> Result<(), <Ctx::Emitter as Emitter<'inp, L, Lang>>::Error>, Ctx: ParseContext<'inp, L, Lang>,

Filter the output of this parser using a validation function. Read more
Source§

fn filter_map<U, F>(self, mapper: F) -> FilterMap<Self, F, O>
where Self: Sized, L: Lexer<'inp>, F: FnMut(O) -> Result<U, <Ctx::Emitter as Emitter<'inp, L, Lang>>::Error>, Ctx: ParseContext<'inp, L, Lang>,

Filter and map the output of this parser using a validation/transformation function. Read more
Source§

fn validate<F>(self, validator: F) -> Validate<Self, F>
where Self: Sized, L: Lexer<'inp>, F: FnMut(&O) -> Result<(), <Ctx::Emitter as Emitter<'inp, L, Lang>>::Error>, Ctx: ParseContext<'inp, L, Lang>,

Validate the output of this parser with full location context. Read more
Source§

fn then_ignore<G, U>(self, second: G) -> ThenIgnore<Self, G, U>
where Self: Sized, G: ParseInput<'inp, L, U, Ctx, Lang>, Ctx: ParseContext<'inp, L, Lang>,

Sequence this parser with another, ignoring the output of the second.
Source§

fn then<T, U>(self, then: T) -> Then<Self, T>
where Self: Sized, T: ParseInput<'inp, L, U, Ctx, Lang>, Ctx: ParseContext<'inp, L, Lang>,

Sequence this parser with another, using the first result to determine the second parser.
Source§

fn ignore_then<G, U>(self, second: G) -> IgnoreThen<Self, G, O>
where Self: Sized, G: ParseInput<'inp, L, U, Ctx, Lang>,

Sequence this parser with another, ignoring the output of the first.
Source§

fn recover<R>(self, recovery: R) -> Recover<Self, R>
where Self: Sized, R: ParseInput<'inp, L, O, Ctx, Lang>, Ctx: ParseContext<'inp, L, Lang>,

Recover from errors produced by this parser using the given recovery parser.
Source§

fn inplace_recover<R>(self, recovery: R) -> InplaceRecover<Self, R>
where Self: Sized, R: ParseInput<'inp, L, O, Ctx, Lang>, Ctx: ParseContext<'inp, L, Lang>,

Recover in-place from errors produced by this parser using the given recovery parser.
Source§

fn padded(self) -> Padded<Self>
where Self: Sized,

Creates a parser that accepts any token with optional padding.
Source§

impl<P: PartialEq, Container: PartialEq, Ctx: PartialEq, Lang: PartialEq + ?Sized> PartialEq for Collect<P, Container, Ctx, Lang>

Source§

fn eq(&self, other: &Collect<P, Container, Ctx, Lang>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<P: Copy, Container: Copy, Ctx: Copy, Lang: Copy + ?Sized> Copy for Collect<P, Container, Ctx, Lang>

Source§

impl<P: Eq, Container: Eq, Ctx: Eq, Lang: Eq + ?Sized> Eq for Collect<P, Container, Ctx, Lang>

Source§

impl<P, Container, Ctx, Lang: ?Sized> StructuralPartialEq for Collect<P, Container, Ctx, Lang>

Auto Trait Implementations§

§

impl<P, Container, Ctx, Lang> Freeze for Collect<P, Container, Ctx, Lang>
where P: Freeze, Container: Freeze, Lang: ?Sized,

§

impl<P, Container, Ctx, Lang> RefUnwindSafe for Collect<P, Container, Ctx, Lang>
where P: RefUnwindSafe, Container: RefUnwindSafe, Ctx: RefUnwindSafe, Lang: RefUnwindSafe + ?Sized,

§

impl<P, Container, Ctx, Lang> Send for Collect<P, Container, Ctx, Lang>
where P: Send, Container: Send, Ctx: Send, Lang: Send + ?Sized,

§

impl<P, Container, Ctx, Lang> Sync for Collect<P, Container, Ctx, Lang>
where P: Sync, Container: Sync, Ctx: Sync, Lang: Sync + ?Sized,

§

impl<P, Container, Ctx, Lang> Unpin for Collect<P, Container, Ctx, Lang>
where P: Unpin, Container: Unpin, Ctx: Unpin, Lang: Unpin + ?Sized,

§

impl<P, Container, Ctx, Lang> UnwindSafe for Collect<P, Container, Ctx, Lang>
where P: UnwindSafe, Container: UnwindSafe, Ctx: UnwindSafe, Lang: UnwindSafe + ?Sized,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.