Struct combine::parser::sequence::Between [−][src]
pub struct Between<Input, L, R, P> where
<Input as StreamOnce>::Error: ParseError<<Input as StreamOnce>::Token, <Input as StreamOnce>::Range, <Input as StreamOnce>::Position>,
Input: Stream,
Input: Stream,
L: Parser<Input>,
R: Parser<Input>,
P: Parser<Input>, {
pub open: L,
pub close: R,
pub parser: P,
// some fields omitted
}
Fields
open: L
close: R
parser: P
Trait Implementations
impl<Input: Clone, L: Clone, R: Clone, P: Clone> Clone for Between<Input, L, R, P> where
<Input as StreamOnce>::Error: ParseError<<Input as StreamOnce>::Token, <Input as StreamOnce>::Range, <Input as StreamOnce>::Position>,
Input: Stream,
Input: Stream,
L: Parser<Input>,
R: Parser<Input>,
P: Parser<Input>,
P::Output: Clone,
impl<Input: Clone, L: Clone, R: Clone, P: Clone> Clone for Between<Input, L, R, P> where
<Input as StreamOnce>::Error: ParseError<<Input as StreamOnce>::Token, <Input as StreamOnce>::Range, <Input as StreamOnce>::Position>,
Input: Stream,
Input: Stream,
L: Parser<Input>,
R: Parser<Input>,
P: Parser<Input>,
P::Output: Clone,
impl<Input, L, R, P> Parser<Input> for Between<Input, L, R, P> where
<Input as StreamOnce>::Error: ParseError<<Input as StreamOnce>::Token, <Input as StreamOnce>::Range, <Input as StreamOnce>::Position>,
Input: Stream,
Input: Stream,
L: Parser<Input>,
R: Parser<Input>,
P: Parser<Input>,
impl<Input, L, R, P> Parser<Input> for Between<Input, L, R, P> where
<Input as StreamOnce>::Error: ParseError<<Input as StreamOnce>::Token, <Input as StreamOnce>::Range, <Input as StreamOnce>::Position>,
Input: Stream,
Input: Stream,
L: Parser<Input>,
R: Parser<Input>,
P: Parser<Input>,
Determines the state necessary to resume parsing after more input is supplied. Read more
fn parse_partial(
&mut self,
input: &mut Input,
state: &mut Self::PartialState
) -> ParseResult<Self::Output, <Input as StreamOnce>::Error>
fn parse_first(
&mut self,
input: &mut Input,
state: &mut Self::PartialState
) -> ParseResult<Self::Output, <Input as StreamOnce>::Error>
fn parse_mode_impl<M>(
&mut self,
mode: M,
input: &mut Input,
state: &mut Self::PartialState
) -> ParseResult<P::Output, <Input as StreamOnce>::Error> where
M: ParseMode,
Adds the first error that would normally be returned by this parser if it failed with an
PeekErr
result. Read more
fn add_committed_expected_error(
&mut self,
errors: &mut Tracked<<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 Input,
state: &mut Self::PartialState
) -> Result<Self::Output, <Input as StreamOnce>::Error>
fn parse_with_state(
&mut self,
input: &mut Input,
state: &mut Self::PartialState
) -> Result<Self::Output, <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 Input
) -> ParseResult<Self::Output, <Input as StreamOnce>::Error>
fn parse_stream(
&mut self,
input: &mut Input
) -> ParseResult<Self::Output, <Input as StreamOnce>::Error>
Parses using the stream input
by calling Stream::uncons
one or more times. Read more
fn parse_lazy(
&mut self,
input: &mut Input
) -> ParseResult<Self::Output, <Input as StreamOnce>::Error>
fn parse_lazy(
&mut self,
input: &mut Input
) -> ParseResult<Self::Output, <Input as StreamOnce>::Error>
Parses using the stream input
by calling Stream::uncons
one or more times. Read more
fn parse_stream_partial(
&mut self,
input: &mut Input,
state: &mut Self::PartialState
) -> ParseResult<Self::Output, <Input as StreamOnce>::Error>
fn parse_stream_partial(
&mut self,
input: &mut Input,
state: &mut Self::PartialState
) -> ParseResult<Self::Output, <Input as StreamOnce>::Error>
Like parse_stream
but supports partial parsing.
Borrows a parser instead of consuming it. Read more
Discards the value of the self
parser and returns the value of p
.
Fails if any of the parsers fails. Read more
Discards the value of the p
parser and returns the value of self
.
Fails if any of the parsers fails. Read more
Parses with self
followed by p
.
Succeeds if both parsers succeed, otherwise fails.
Returns a tuple with both values on success. Read more
Returns a parser which attempts to parse using self
. If self
fails without committing
it tries to consume the same input using p
. Read more
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
Self: Sized,
F: FnMut(&mut Self::Output) -> N,
N: Parser<Input>,
fn then_partial<N, F>(self, f: F) -> ThenPartial<Self, F> where
Self: Sized,
F: FnMut(&mut Self::Output) -> N,
N: Parser<Input>,
Parses using self
and then passes a reference to the value to f
which returns a parser
used to parse the rest of the input. The value is then combined with the output of f
. Read more
Uses f
to map over the parsed value. Read more
fn map_input<F, B>(self, f: F) -> MapInput<Self, F> where
Self: Sized,
F: FnMut(Self::Output, &mut Input) -> B,
Uses f
to map over the output of self
. If f
returns an error the parser fails. Read more
Parses with self
and if it fails, adds the message msg
to the error. Read more
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
Parses with self
, if it fails without consuming any input any expected errors that would
otherwise be emitted by self
are suppressed. Read more
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 partial_iter<'a, 's, M>(
self,
mode: M,
input: &'a mut Input,
partial_state: &'s mut Self::PartialState
) -> Iter<'a, Input, Self, &'s mut Self::PartialState, M>ⓘ where
Self: Parser<Input> + Sized,
M: ParseMode,
fn partial_iter<'a, 's, M>(
self,
mode: M,
input: &'a mut Input,
partial_state: &'s mut Self::PartialState
) -> Iter<'a, Input, Self, &'s mut Self::PartialState, M>ⓘ where
Self: Parser<Input> + Sized,
M: ParseMode,
fn boxed<'a>(
self
) -> Box<dyn Parser<Input, Output = Self::Output, PartialState = Self::PartialState> + 'a>ⓘimpl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;
where
Self: Sized + 'a,
fn boxed<'a>(
self
) -> Box<dyn Parser<Input, Output = Self::Output, PartialState = Self::PartialState> + 'a>ⓘimpl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;
where
Self: Sized + 'a,
impl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;
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
impl<Input: Copy, L: Copy, R: Copy, P: Copy> Copy for Between<Input, L, R, P> where
<Input as StreamOnce>::Error: ParseError<<Input as StreamOnce>::Token, <Input as StreamOnce>::Range, <Input as StreamOnce>::Position>,
Input: Stream,
Input: Stream,
L: Parser<Input>,
R: Parser<Input>,
P: Parser<Input>,
P::Output: Copy,
Auto Trait Implementations
impl<Input, L, R, P> RefUnwindSafe for Between<Input, L, R, P> where
L: RefUnwindSafe,
P: RefUnwindSafe,
R: RefUnwindSafe,
impl<Input, L, R, P> UnwindSafe for Between<Input, L, R, P> where
L: UnwindSafe,
P: UnwindSafe,
R: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more