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],
) -> ParseResult<ParseStatus<'a, Self::PartialState, Self::Output>>
fn parse<'a>( &self, state: &FloatParserState, input: &'a [u8], ) -> ParseResult<ParseStatus<'a, Self::PartialState, Self::Output>>
Parse the given input.
source§impl PartialEq for FloatParser
impl PartialEq for FloatParser
impl StructuralPartialEq for FloatParser
Auto Trait Implementations§
impl Freeze for FloatParser
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<P> ParserExt for Pwhere
P: Parser,
impl<P> ParserExt for Pwhere
P: Parser,
source§fn otherwise<V: Parser>(self, other: V) -> ChoiceParser<Self, V>where
Self: Sized,
fn otherwise<V: Parser>(self, other: V) -> ChoiceParser<Self, V>where
Self: Sized,
Parse this parser, or another other parser.
source§fn or<V: Parser<Output = Self::Output>>(
self,
other: V,
) -> MapOutputParser<ChoiceParser<Self, V>, Self::Output>where
Self: Sized,
fn or<V: Parser<Output = Self::Output>>(
self,
other: V,
) -> MapOutputParser<ChoiceParser<Self, V>, Self::Output>where
Self: Sized,
Parse this parser, or another other parser with the same type
source§fn then<V: Parser>(self, other: V) -> SequenceParser<Self, V>where
Self: Sized,
fn then<V: Parser>(self, other: V) -> SequenceParser<Self, V>where
Self: Sized,
Parse this parser, then the other parser.
source§fn then_lazy<V, F>(self, other: F) -> ThenLazy<Self, F>
fn then_lazy<V, F>(self, other: F) -> ThenLazy<Self, F>
Parse this parser, then the other parser that is created base on the output of this parser.
source§fn ignore_output_then<V: CreateParserState>(
self,
other: V,
) -> MapOutputParser<SequenceParser<Self, V>, <V as Parser>::Output>where
Self: Sized,
fn ignore_output_then<V: CreateParserState>(
self,
other: V,
) -> MapOutputParser<SequenceParser<Self, V>, <V as Parser>::Output>where
Self: Sized,
Parse this parser, then the other parser while ignoring the current parser’s output.
source§fn then_ignore_output<V: CreateParserState>(
self,
other: V,
) -> MapOutputParser<SequenceParser<Self, V>, <Self as Parser>::Output>where
Self: Sized,
fn then_ignore_output<V: CreateParserState>(
self,
other: V,
) -> MapOutputParser<SequenceParser<Self, V>, <Self as Parser>::Output>where
Self: Sized,
Parse this parser, then the other parser while ignoring the output of the other parser.
source§fn then_literal(
self,
literal: impl Into<Cow<'static, str>>,
) -> MapOutputParser<SequenceParser<Self, LiteralParser>, <Self as Parser>::Output>where
Self: Sized,
fn then_literal(
self,
literal: impl Into<Cow<'static, str>>,
) -> MapOutputParser<SequenceParser<Self, LiteralParser>, <Self as Parser>::Output>where
Self: Sized,
Parse this parser, then a literal. This is equivalent to
.then_ignore_output(LiteralParser::new(literal))
.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, O>(self, f: F) -> MapOutputParser<Self, O, F>
fn map_output<F, O>(self, f: F) -> MapOutputParser<Self, O, F>
Map the output of this parser.
source§fn boxed(self) -> ArcParser<Self::Output>where
Self: CreateParserState + Sized + Send + Sync + 'static,
Self::Output: Send + Sync + 'static,
Self::PartialState: Send + Sync + 'static,
fn boxed(self) -> ArcParser<Self::Output>where
Self: CreateParserState + Sized + Send + Sync + 'static,
Self::Output: Send + Sync + 'static,
Self::PartialState: Send + Sync + 'static,
Get a boxed version of this parser.
source§fn with_initial_state<F: Fn() -> Self::PartialState + Clone>(
self,
initial_state: F,
) -> WithInitialState<Self, F>where
Self: Sized,
fn with_initial_state<F: Fn() -> Self::PartialState + Clone>(
self,
initial_state: F,
) -> WithInitialState<Self, F>where
Self: Sized,
Create a new parser with a different initial state