pub struct Empty(/* private fields */);Expand description
A parser that always succeeds without consuming any input.
Implementations§
Trait Implementations§
Source§impl<'inp, L, Ctx, Lang> ParseInput<'inp, L, (), Ctx, Lang> for Empty
impl<'inp, L, Ctx, Lang> ParseInput<'inp, L, (), Ctx, Lang> for Empty
Source§fn parse_input(
&mut self,
_inp: &mut InputRef<'inp, '_, L, Ctx, Lang>,
) -> Result<(), <Ctx::Emitter as Emitter<'inp, L, Lang>>::Error>where
L: Lexer<'inp>,
Ctx: ParseContext<'inp, L, Lang>,
fn parse_input(
&mut self,
_inp: &mut InputRef<'inp, '_, L, Ctx, Lang>,
) -> Result<(), <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,
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,
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,
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 repeated<Condition, W>(
self,
condition: Condition,
) -> Repeated<Self, Condition, O, W>
fn repeated<Condition, W>( self, condition: Condition, ) -> Repeated<Self, Condition, O, W>
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>
fn separated_by<SepClassifier, Condition, W>( self, sep_classifier: SepClassifier, condition: Condition, ) -> SeparatedBy<Self, SepClassifier, Condition, O, W, L, Ctx>
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,
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>
fn peek_then<C, W>(self, condition: C) -> PeekThen<Self, C, L::Token, W>
Creates a
PeekThen combinator that peeks at most N tokens first from the input before parsing. Read moreSource§fn peek_then_or_not<C, W>(
self,
condition: C,
) -> OrNot<PeekThen<Self, C, L::Token, W>>
fn peek_then_or_not<C, W>( self, condition: C, ) -> OrNot<PeekThen<Self, C, L::Token, W>>
Creates a
PeekThen combinator that peeks at most N tokens first from the input before parsing. Read moreSource§fn map<U, F>(self, f: F) -> Map<Self, F, L, Ctx, O, U, Lang>
fn map<U, F>(self, f: F) -> Map<Self, F, L, Ctx, O, U, Lang>
Map the output of this parser using the given function.
Source§fn filter<F>(self, validator: F) -> Filter<Self, F>
fn filter<F>(self, validator: F) -> Filter<Self, F>
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>
fn filter_map<U, F>(self, mapper: F) -> FilterMap<Self, F, O>
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>
fn validate<F>(self, validator: F) -> Validate<Self, F>
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>
fn then_ignore<G, U>(self, second: G) -> ThenIgnore<Self, G, U>
Sequence this parser with another, ignoring the output of the second.
Source§fn then<T, U>(self, then: T) -> Then<Self, T>
fn then<T, U>(self, then: T) -> Then<Self, T>
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>,
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>
fn recover<R>(self, recovery: R) -> Recover<Self, R>
Recover from errors produced by this parser using the given recovery parser.
Source§fn inplace_recover<R>(self, recovery: R) -> InplaceRecover<Self, R>
fn inplace_recover<R>(self, recovery: R) -> InplaceRecover<Self, R>
Recover in-place from errors produced by this parser using the given recovery parser.
impl Copy for Empty
impl Eq for Empty
impl StructuralPartialEq for Empty
Auto Trait Implementations§
impl Freeze for Empty
impl RefUnwindSafe for Empty
impl Send for Empty
impl Sync for Empty
impl Unpin for Empty
impl UnwindSafe for Empty
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