Struct kalosm_sample::LiteralParser
source · pub struct LiteralParser<S: AsRef<str>> { /* private fields */ }
Expand description
A parser for a literal.
Implementations§
Trait Implementations§
source§impl<S: Clone + AsRef<str>> Clone for LiteralParser<S>
impl<S: Clone + AsRef<str>> Clone for LiteralParser<S>
source§fn clone(&self) -> LiteralParser<S>
fn clone(&self) -> LiteralParser<S>
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<S: AsRef<str>> CreateParserState for LiteralParser<S>
impl<S: AsRef<str>> CreateParserState for LiteralParser<S>
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<S: AsRef<str>> Parser for LiteralParser<S>
impl<S: AsRef<str>> Parser for LiteralParser<S>
§type Error = LiteralMismatchError
type Error = LiteralMismatchError
The error type of the parser.
§type PartialState = LiteralParserOffset
type PartialState = LiteralParserOffset
The state of the parser.
source§fn parse<'a>(
&self,
state: &LiteralParserOffset,
input: &'a [u8]
) -> Result<ParseResult<'a, Self::PartialState, Self::Output>, Self::Error>
fn parse<'a>( &self, state: &LiteralParserOffset, input: &'a [u8] ) -> Result<ParseResult<'a, Self::PartialState, Self::Output>, Self::Error>
Parse the given input.
source§impl<S: PartialEq + AsRef<str>> PartialEq for LiteralParser<S>
impl<S: PartialEq + AsRef<str>> PartialEq for LiteralParser<S>
source§fn eq(&self, other: &LiteralParser<S>) -> bool
fn eq(&self, other: &LiteralParser<S>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl<S: Copy + AsRef<str>> Copy for LiteralParser<S>
impl<S: Eq + AsRef<str>> Eq for LiteralParser<S>
impl<S: AsRef<str>> StructuralPartialEq for LiteralParser<S>
Auto Trait Implementations§
impl<S> RefUnwindSafe for LiteralParser<S>where
S: RefUnwindSafe,
impl<S> Send for LiteralParser<S>where
S: Send,
impl<S> Sync for LiteralParser<S>where
S: Sync,
impl<S> Unpin for LiteralParser<S>where
S: Unpin,
impl<S> UnwindSafe for LiteralParser<S>where
S: 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.