pub struct OctDigit<I>(/* private fields */)
where
I: Stream<Item = u8>,
I::Error: ParseError<u8, I::Range, I::Position>;
Trait Implementations§
Source§impl<I> Parser for OctDigit<I>
impl<I> Parser for OctDigit<I>
Source§type Input = I
type Input = I
The type which is taken as input for the parser. The type must implement the
Stream
trait
which allows the parser to read items from the type.Source§type Output = <Expected<Satisfy<I, fn(_: u8) -> bool>> as Parser>::Output
type Output = <Expected<Satisfy<I, fn(_: u8) -> bool>> as Parser>::Output
The type which is returned if the parser is successful.
Source§type PartialState = <Expected<Satisfy<I, fn(_: u8) -> bool>> as Parser>::PartialState
type PartialState = <Expected<Satisfy<I, fn(_: u8) -> bool>> as Parser>::PartialState
Determines the state necessary to resume parsing after more input is supplied. Read more
Source§fn parse_lazy(
&mut self,
input: &mut Self::Input,
) -> ConsumedResult<Self::Output, Self::Input>
fn parse_lazy( &mut self, input: &mut Self::Input, ) -> ConsumedResult<Self::Output, Self::Input>
Source§fn parse_first(
&mut self,
input: &mut Self::Input,
state: &mut Self::PartialState,
) -> ConsumedResult<Self::Output, Self::Input>
fn parse_first( &mut self, input: &mut Self::Input, state: &mut Self::PartialState, ) -> ConsumedResult<Self::Output, Self::Input>
Parses using the stream
input
and allows itself to be resumed at a later point using
parse_partial
by storing the necessary intermediate state in state
. Read moreSource§fn parse_partial(
&mut self,
input: &mut Self::Input,
state: &mut Self::PartialState,
) -> ConsumedResult<Self::Output, Self::Input>
fn parse_partial( &mut self, input: &mut Self::Input, state: &mut Self::PartialState, ) -> ConsumedResult<Self::Output, Self::Input>
Parses using the stream
input
and allows itself to be resumed at a later point using
parse_partial
by storing the necessary intermediate state in state
Source§fn add_error(&mut self, error: &mut Tracked<<Self::Input as StreamOnce>::Error>)
fn add_error(&mut self, error: &mut Tracked<<Self::Input as StreamOnce>::Error>)
Adds the first error that would normally be returned by this parser if it failed with an
EmptyErr
result. Read moreSource§fn easy_parse<I>(
&mut self,
input: I,
) -> Result<(Self::Output, I), ParseError<I>>
fn easy_parse<I>( &mut self, input: I, ) -> Result<(Self::Output, I), ParseError<I>>
Entry point of the parser. Takes some input and tries to parse it, returning an easy to use
and format error if parsing did not succeed. Read more
Source§fn parse(
&mut self,
input: Self::Input,
) -> Result<(Self::Output, Self::Input), <Self::Input as StreamOnce>::Error>
fn parse( &mut self, input: Self::Input, ) -> Result<(Self::Output, Self::Input), <Self::Input as StreamOnce>::Error>
Entry point of the parser. Takes some input and tries to parse it. Read more
Source§fn parse_with_state(
&mut self,
input: &mut Self::Input,
state: &mut Self::PartialState,
) -> Result<Self::Output, <Self::Input as StreamOnce>::Error>
fn parse_with_state( &mut self, input: &mut Self::Input, state: &mut Self::PartialState, ) -> Result<Self::Output, <Self::Input as StreamOnce>::Error>
Entry point of the parser when using partial parsing.
Takes some input and tries to parse it. Read more
Source§fn parse_stream(
&mut self,
input: &mut Self::Input,
) -> ParseResult<Self::Output, Self::Input>
fn parse_stream( &mut self, input: &mut Self::Input, ) -> ParseResult<Self::Output, Self::Input>
Source§fn parse_stream_consumed(
&mut self,
input: &mut Self::Input,
) -> ConsumedResult<Self::Output, Self::Input>
fn parse_stream_consumed( &mut self, input: &mut Self::Input, ) -> ConsumedResult<Self::Output, Self::Input>
fn parse_stream_consumed_partial( &mut self, input: &mut Self::Input, state: &mut Self::PartialState, ) -> ConsumedResult<Self::Output, Self::Input>
Source§fn by_ref(&mut self) -> &mut Selfwhere
Self: Sized,
fn by_ref(&mut self) -> &mut Selfwhere
Self: Sized,
Borrows a parser instead of consuming it. Read more
Source§fn with<P2>(self, p: P2) -> With<Self, P2>
fn with<P2>(self, p: P2) -> With<Self, P2>
Discards the value of the
self
parser and returns the value of p
.
Fails if any of the parsers fails. Read moreSource§fn skip<P2>(self, p: P2) -> Skip<Self, P2>
fn skip<P2>(self, p: P2) -> Skip<Self, P2>
Discards the value of the
p
parser and returns the value of self
.
Fails if any of the parsers fails. Read moreSource§fn and<P2>(self, p: P2) -> (Self, P2)
fn and<P2>(self, p: P2) -> (Self, P2)
Parses with
self
followed by p
.
Succeeds if both parsers succeed, otherwise fails.
Returns a tuple with both values on success. Read moreSource§fn or<P2>(self, p: P2) -> Or<Self, P2>
fn or<P2>(self, p: P2) -> Or<Self, P2>
Returns a parser which attempts to parse using
self
. If self
fails without consuming
any input it tries to consume the same input using p
. Read moreSource§fn then<N, F>(self, f: F) -> Then<Self, F>
fn then<N, F>(self, f: F) -> Then<Self, F>
Parses using
self
and then passes the value to f
which returns a parser used to parse
the rest of the input. Read moreSource§fn then_partial<N, F>(self, f: F) -> ThenPartial<Self, F>
fn then_partial<N, F>(self, f: F) -> ThenPartial<Self, F>
Variant of
then
which parses using self
and then passes the value to f
as a &mut
reference. Read moreSource§fn message<S>(self, msg: S) -> Message<Self>where
Self: Sized,
S: Into<Info<<Self::Input as StreamOnce>::Item, <Self::Input as StreamOnce>::Range>>,
fn message<S>(self, msg: S) -> Message<Self>where
Self: Sized,
S: Into<Info<<Self::Input as StreamOnce>::Item, <Self::Input as StreamOnce>::Range>>,
Source§fn expected<S>(self, msg: S) -> Expected<Self>where
Self: Sized,
S: Into<Info<<Self::Input as StreamOnce>::Item, <Self::Input as StreamOnce>::Range>>,
fn expected<S>(self, msg: S) -> Expected<Self>where
Self: Sized,
S: Into<Info<<Self::Input as StreamOnce>::Item, <Self::Input as StreamOnce>::Range>>,
Parses with
self
and if it fails without consuming any input any expected errors are
replaced by msg
. msg
is then used in error messages as “Expected msg
”. Read moreSource§fn silent(self) -> Silent<Self>where
Self: Sized,
fn silent(self) -> Silent<Self>where
Self: Sized,
Parses with
self
, if it fails without consuming any input any expected errors that would
otherwise be emitted by self
are suppressed. Read moreSource§fn and_then<F, O, E, I>(self, f: F) -> AndThen<Self, F>
fn and_then<F, O, E, I>(self, f: F) -> AndThen<Self, F>
Parses with
self
and applies f
on the result if self
parses successfully.
f
may optionally fail with an error which is automatically converted to a ParseError
. Read moreSource§fn iter(
self,
input: &mut <Self as Parser>::Input,
) -> Iter<'_, Self, Self::PartialState, FirstMode> ⓘ
fn iter( self, input: &mut <Self as Parser>::Input, ) -> Iter<'_, Self, Self::PartialState, FirstMode> ⓘ
Source§fn partial_iter<'a, 's, M>(
self,
mode: M,
input: &'a mut <Self as Parser>::Input,
partial_state: &'s mut Self::PartialState,
) -> Iter<'a, Self, &'s mut Self::PartialState, M> ⓘ
fn partial_iter<'a, 's, M>( self, mode: M, input: &'a mut <Self as Parser>::Input, partial_state: &'s mut Self::PartialState, ) -> Iter<'a, Self, &'s mut Self::PartialState, M> ⓘ
Source§fn boxed<'a>(
self,
) -> Box<dyn Parser<Input = Self::Input, Output = Self::Output, PartialState = Self::PartialState> + 'a>where
Self: Sized + 'a,
fn boxed<'a>(
self,
) -> Box<dyn Parser<Input = Self::Input, Output = Self::Output, PartialState = Self::PartialState> + 'a>where
Self: Sized + 'a,
Turns the parser into a trait object by putting it in a
Box
. Can be used to easily
return parsers from functions without naming the type. Read moreAuto Trait Implementations§
impl<I> Freeze for OctDigit<I>
impl<I> RefUnwindSafe for OctDigit<I>
impl<I> Send for OctDigit<I>
impl<I> Sync for OctDigit<I>
impl<I> Unpin for OctDigit<I>
impl<I> UnwindSafe for OctDigit<I>
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§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more