Struct kalosm_sample::FloatParser
source · pub struct FloatParser { /* private fields */ }
Expand description
A parser for a float.
Implementations§
source§impl FloatParser
impl FloatParser
sourcepub fn new(range: RangeInclusive<f64>) -> Self
pub fn new(range: RangeInclusive<f64>) -> Self
Create a new float parser.
Trait Implementations§
source§impl Clone for FloatParser
impl Clone for FloatParser
source§fn clone(&self) -> FloatParser
fn clone(&self) -> FloatParser
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 CreateParserState for FloatParser
impl CreateParserState for FloatParser
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 Debug for FloatParser
impl Debug for FloatParser
source§impl Parser for FloatParser
impl Parser for FloatParser
§type PartialState = FloatParserState
type PartialState = FloatParserState
The state of the parser.
source§fn parse<'a>(
&self,
state: &FloatParserState,
input: &'a [u8]
) -> Result<ParseResult<'a, Self::PartialState, Self::Output>, Self::Error>
fn parse<'a>( &self, state: &FloatParserState, input: &'a [u8] ) -> Result<ParseResult<'a, Self::PartialState, Self::Output>, Self::Error>
Parse the given input.
source§impl PartialEq for FloatParser
impl PartialEq for FloatParser
source§fn eq(&self, other: &FloatParser) -> bool
fn eq(&self, other: &FloatParser) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for FloatParser
Auto Trait Implementations§
impl RefUnwindSafe for FloatParser
impl Send for FloatParser
impl Sync for FloatParser
impl Unpin for FloatParser
impl UnwindSafe for FloatParser
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> 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.