Empty

Struct Empty 

Source
pub struct Empty(/* private fields */);
Expand description

A parser that always succeeds without consuming any input.

Implementations§

Source§

impl Empty

Source

pub const fn new() -> Self

Creates a parser that always succeeds without consuming any input.

Trait Implementations§

Source§

impl Clone for Empty

Source§

fn clone(&self) -> Empty

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 Debug for Empty

Source§

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

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

impl Default for Empty

Source§

fn default() -> Empty

Returns the “default value” for a type. Read more
Source§

impl Hash for Empty

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, L, Ctx, Lang> ParseInput<'inp, L, (), Ctx, Lang> for Empty
where L: Lexer<'inp>, Ctx: ParseContext<'inp, L, Lang>, Lang: ?Sized,

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>,

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 PartialEq for Empty

Source§

fn eq(&self, other: &Empty) -> 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 Copy for Empty

Source§

impl Eq for Empty

Source§

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> 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.