[−][src]Struct combine_language::WhiteSpace
A whitespace parser for a language
Trait Implementations
impl<'a: 'b, 'b, I: Clone> Clone for WhiteSpace<'a, 'b, I> where
I: Stream<Item = char> + 'b,
I::Error: ParseError<I::Item, I::Range, I::Position>,
[src]
I: Stream<Item = char> + 'b,
I::Error: ParseError<I::Item, I::Range, I::Position>,
fn clone(&self) -> WhiteSpace<'a, 'b, I>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<'a, 'b, I> Parser for WhiteSpace<'a, 'b, I> where
I: Stream<Item = char> + 'b,
I::Error: ParseError<I::Item, I::Range, I::Position>,
[src]
I: Stream<Item = char> + 'b,
I::Error: ParseError<I::Item, I::Range, I::Position>,
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. Read more
type Output = ()
The type which is returned if the parser is successful.
type PartialState = ()
Determines the state necessary to resume parsing after more input is supplied. Read more
fn parse_lazy(&mut self, input: &mut I) -> ConsumedResult<(), I>
[src]
fn easy_parse<I>(
&mut self,
input: I
) -> Result<(Self::Output, I), Errors<<I as StreamOnce>::Item, <I as StreamOnce>::Range, <I as StreamOnce>::Position>> where
I: Stream,
Self: Parser<Input = Stream<I>>,
Stream<I>: StreamOnce,
<I as StreamOnce>::Position: Default,
<Stream<I> as StreamOnce>::Item == <I as StreamOnce>::Item,
<Stream<I> as StreamOnce>::Range == <I as StreamOnce>::Range,
<Stream<I> as StreamOnce>::Error == Errors<<Stream<I> as StreamOnce>::Item, <Stream<I> as StreamOnce>::Range, <Stream<I> as StreamOnce>::Position>,
<Stream<I> as StreamOnce>::Position == <I as StreamOnce>::Position,
[src]
&mut self,
input: I
) -> Result<(Self::Output, I), Errors<<I as StreamOnce>::Item, <I as StreamOnce>::Range, <I as StreamOnce>::Position>> where
I: Stream,
Self: Parser<Input = Stream<I>>,
Stream<I>: StreamOnce,
<I as StreamOnce>::Position: Default,
<Stream<I> as StreamOnce>::Item == <I as StreamOnce>::Item,
<Stream<I> as StreamOnce>::Range == <I as StreamOnce>::Range,
<Stream<I> as StreamOnce>::Error == Errors<<Stream<I> as StreamOnce>::Item, <Stream<I> as StreamOnce>::Range, <Stream<I> as StreamOnce>::Position>,
<Stream<I> as StreamOnce>::Position == <I as StreamOnce>::Position,
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
fn parse(
&mut self,
input: Self::Input
) -> Result<(Self::Output, Self::Input), <Self::Input as StreamOnce>::Error>
[src]
&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
fn parse_with_state(
&mut self,
input: &mut Self::Input,
state: &mut Self::PartialState
) -> Result<Self::Output, <Self::Input as StreamOnce>::Error>
[src]
&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
fn parse_stream(
&mut self,
input: &mut Self::Input
) -> Result<(Self::Output, Consumed<()>), Consumed<Tracked<<Self::Input as StreamOnce>::Error>>>
[src]
&mut self,
input: &mut Self::Input
) -> Result<(Self::Output, Consumed<()>), Consumed<Tracked<<Self::Input as StreamOnce>::Error>>>
Parses using the stream input
by calling [Stream::uncons
] one or more times. Read more
fn parse_stream_consumed(
&mut self,
input: &mut Self::Input
) -> FastResult<Self::Output, <Self::Input as StreamOnce>::Error>
[src]
&mut self,
input: &mut Self::Input
) -> FastResult<Self::Output, <Self::Input as StreamOnce>::Error>
Parses using the stream input
by calling [Stream::uncons
] one or more times. Read more
fn parse_stream_consumed_partial(
&mut self,
input: &mut Self::Input,
state: &mut Self::PartialState
) -> FastResult<Self::Output, <Self::Input as StreamOnce>::Error>
[src]
&mut self,
input: &mut Self::Input,
state: &mut Self::PartialState
) -> FastResult<Self::Output, <Self::Input as StreamOnce>::Error>
fn parse_first(
&mut self,
input: &mut Self::Input,
state: &mut Self::PartialState
) -> FastResult<Self::Output, <Self::Input as StreamOnce>::Error>
[src]
&mut self,
input: &mut Self::Input,
state: &mut Self::PartialState
) -> FastResult<Self::Output, <Self::Input as StreamOnce>::Error>
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 more
fn parse_partial(
&mut self,
input: &mut Self::Input,
state: &mut Self::PartialState
) -> FastResult<Self::Output, <Self::Input as StreamOnce>::Error>
[src]
&mut self,
input: &mut Self::Input,
state: &mut Self::PartialState
) -> FastResult<Self::Output, <Self::Input as StreamOnce>::Error>
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 more
fn add_error(
&mut self,
_error: &mut Tracked<<Self::Input as StreamOnce>::Error>
)
[src]
&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 more
fn by_ref(&mut self) -> &mut Self
[src]
Borrows a parser instead of consuming it. Read more
fn with<P2>(self, p: P2) -> With<Self, P2> where
P2: Parser<Input = Self::Input>,
[src]
P2: Parser<Input = Self::Input>,
Discards the value of the self
parser and returns the value of p
. Fails if any of the parsers fails. Read more
fn skip<P2>(self, p: P2) -> Skip<Self, P2> where
P2: Parser<Input = Self::Input>,
[src]
P2: Parser<Input = Self::Input>,
Discards the value of the p
parser and returns the value of self
. Fails if any of the parsers fails. Read more
fn and<P2>(self, p: P2) -> (Self, P2) where
P2: Parser<Input = Self::Input>,
[src]
P2: Parser<Input = Self::Input>,
Parses with self
followed by p
. Succeeds if both parsers succeed, otherwise fails. Returns a tuple with both values on success. Read more
fn or<P2>(self, p: P2) -> Or<Self, P2> where
P2: Parser<Input = Self::Input, Output = Self::Output>,
[src]
P2: Parser<Input = Self::Input, Output = Self::Output>,
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 more
fn then<N, F>(self, f: F) -> Then<Self, F> where
F: FnMut(Self::Output) -> N,
N: Parser<Input = Self::Input>,
[src]
F: FnMut(Self::Output) -> N,
N: Parser<Input = Self::Input>,
Parses using self
and then passes the value to f
which returns a parser used to parse the rest of the input. Read more
fn then_partial<N, F>(self, f: F) -> ThenPartial<Self, F> where
F: FnMut(&mut Self::Output) -> N,
N: Parser<Input = Self::Input>,
[src]
F: FnMut(&mut Self::Output) -> N,
N: Parser<Input = Self::Input>,
Variant of then
which parses using self
and then passes the value to f
as a &mut
reference. Read more
fn map<F, B>(self, f: F) -> Map<Self, F> where
F: FnMut(Self::Output) -> B,
[src]
F: FnMut(Self::Output) -> B,
Uses f
to map over the parsed value. Read more
fn flat_map<F, B>(self, f: F) -> FlatMap<Self, F> where
F: FnMut(Self::Output) -> Result<B, <Self::Input as StreamOnce>::Error>,
[src]
F: FnMut(Self::Output) -> Result<B, <Self::Input as StreamOnce>::Error>,
Uses f
to map over the output of self
. If f
returns an error the parser fails. Read more
fn message<S>(self, msg: S) -> Message<Self> where
S: Into<Info<<Self::Input as StreamOnce>::Item, <Self::Input as StreamOnce>::Range>>,
[src]
S: Into<Info<<Self::Input as StreamOnce>::Item, <Self::Input as StreamOnce>::Range>>,
Parses with self
and if it fails, adds the message msg
to the error. Read more
fn expected<S>(self, msg: S) -> Expected<Self> where
S: Into<Info<<Self::Input as StreamOnce>::Item, <Self::Input as StreamOnce>::Range>>,
[src]
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 more
fn silent(self) -> Silent<Self>
[src]
Parses with self
, if it fails without consuming any input any expected errors that would otherwise be emitted by self
are suppressed. Read more
fn and_then<F, O, E, I>(self, f: F) -> AndThen<Self, F> where
E: Into<<<I as StreamOnce>::Error as ParseError<<I as StreamOnce>::Item, <I as StreamOnce>::Range, <I as StreamOnce>::Position>>::StreamError>,
F: FnMut(Self::Output) -> Result<O, E>,
I: Stream,
Self: Parser<Input = I>,
[src]
E: Into<<<I as StreamOnce>::Error as ParseError<<I as StreamOnce>::Item, <I as StreamOnce>::Range, <I as StreamOnce>::Position>>::StreamError>,
F: FnMut(Self::Output) -> Result<O, E>,
I: Stream,
Self: Parser<Input = I>,
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 more
fn iter(
self,
input: &mut Self::Input
) -> Iter<Self, Self::PartialState, FirstMode> where
Self: Parser,
[src]
self,
input: &mut Self::Input
) -> Iter<Self, Self::PartialState, FirstMode> where
Self: Parser,
Creates an iterator from a parser and a state. Can be used as an alternative to [many
] when collecting directly into a Extend
type is not desirable. Read more
fn partial_iter<M>(
self,
mode: M,
input: &'a mut Self::Input,
partial_state: &'s mut Self::PartialState
) -> Iter<'a, Self, &'s mut Self::PartialState, M> where
M: ParseMode,
Self: Parser,
[src]
self,
mode: M,
input: &'a mut Self::Input,
partial_state: &'s mut Self::PartialState
) -> Iter<'a, Self, &'s mut Self::PartialState, M> where
M: ParseMode,
Self: Parser,
Creates an iterator from a parser and a state. Can be used as an alternative to [many
] when collecting directly into a Extend
type is not desirable. Read more
fn boxed<'a>(
self
) -> Box<dyn Parser<Output = Self::Output, PartialState = Self::PartialState, Input = Self::Input> + 'a> where
Self: 'a,
[src]
self
) -> Box<dyn Parser<Output = Self::Output, PartialState = Self::PartialState, Input = Self::Input> + 'a> where
Self: '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 more
fn left<R>(self) -> Either<Self, R> where
R: Parser<Input = Self::Input, Output = Self::Output>,
[src]
R: Parser<Input = Self::Input, Output = Self::Output>,
Wraps the parser into the Either
enum which allows combinators such as then
to return multiple different parser types (merging them to one) Read more
fn right<L>(self) -> Either<L, Self> where
L: Parser<Input = Self::Input, Output = Self::Output>,
[src]
L: Parser<Input = Self::Input, Output = Self::Output>,
Wraps the parser into the Either
enum which allows combinators such as then
to return multiple different parser types (merging them to one) Read more
Auto Trait Implementations
impl<'a, 'b, I> !Send for WhiteSpace<'a, 'b, I>
impl<'a, 'b, I> !Sync for WhiteSpace<'a, 'b, I>
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T, U> TryFrom for T where
T: From<U>,
[src]
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,