pub struct Message<P, S>(/* private fields */);Trait Implementations§
Source§impl<Input, P, S> Parser<Input> for Message<P, S>where
Input: Stream,
P: Parser<Input>,
S: for<'s> ErrorInfo<'s, <Input as StreamOnce>::Token, <Input as StreamOnce>::Range>,
impl<Input, P, S> Parser<Input> for Message<P, S>where
Input: Stream,
P: Parser<Input>,
S: for<'s> ErrorInfo<'s, <Input as StreamOnce>::Token, <Input as StreamOnce>::Range>,
Source§type Output = <P as Parser<Input>>::Output
type Output = <P as Parser<Input>>::Output
The type which is returned if the parser is successful.
Source§type PartialState = <P as Parser<Input>>::PartialState
type PartialState = <P as Parser<Input>>::PartialState
Determines the state necessary to resume parsing after more input is supplied. Read more
Source§fn add_error(&mut self, errors: &mut Tracked<<Input as StreamOnce>::Error>)
fn add_error(&mut self, errors: &mut Tracked<<Input as StreamOnce>::Error>)
Adds the first error that would normally be returned by this parser if it failed with an
PeekErr result. Read moreSource§fn parse(
&mut self,
input: Input,
) -> Result<(Self::Output, Input), <Input as StreamOnce>::Error>
fn parse( &mut self, input: Input, ) -> Result<(Self::Output, Input), <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 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
Source§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>
Source§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>
Source§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.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 committing
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>
Source§fn then_ref<N, F>(self, f: F) -> ThenRef<Self, F>
fn then_ref<N, F>(self, f: F) -> ThenRef<Self, F>
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 morefn map_input<F, B>(self, f: F) -> MapInput<Self, F>
Source§fn message<S>(self, msg: S) -> Message<Self, S>where
Self: Sized,
S: for<'s> ErrorInfo<'s, <Input as StreamOnce>::Token, <Input as StreamOnce>::Range>,
fn message<S>(self, msg: S) -> Message<Self, S>where
Self: Sized,
S: for<'s> ErrorInfo<'s, <Input as StreamOnce>::Token, <Input as StreamOnce>::Range>,
Source§fn expected<S>(self, msg: S) -> Expected<Self, S>where
Self: Sized,
S: for<'s> ErrorInfo<'s, <Input as StreamOnce>::Token, <Input as StreamOnce>::Range>,
fn expected<S>(self, msg: S) -> Expected<Self, S>where
Self: Sized,
S: for<'s> ErrorInfo<'s, <Input as StreamOnce>::Token, <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>(self, f: F) -> AndThen<Self, F>where
Self: Sized + Parser<Input>,
F: FnMut(Self::Output) -> Result<O, E>,
E: Into<<<Input as StreamOnce>::Error as ParseError<<Input as StreamOnce>::Token, <Input as StreamOnce>::Range, <Input as StreamOnce>::Position>>::StreamError>,
fn and_then<F, O, E>(self, f: F) -> AndThen<Self, F>where
Self: Sized + Parser<Input>,
F: FnMut(Self::Output) -> Result<O, E>,
E: Into<<<Input as StreamOnce>::Error as ParseError<<Input as StreamOnce>::Token, <Input as StreamOnce>::Range, <Input as StreamOnce>::Position>>::StreamError>,
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 Input,
) -> Iter<'_, Input, Self, Self::PartialState, FirstMode> ⓘ
fn iter( self, input: &mut Input, ) -> Iter<'_, Input, Self, Self::PartialState, FirstMode> ⓘ
Source§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> ⓘ
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> ⓘ
Source§fn boxed<'a>(
self,
) -> Box<dyn Parser<Input, Output = Self::Output, PartialState = Self::PartialState> + 'a>where
Self: Sized + 'a,
fn boxed<'a>(
self,
) -> Box<dyn Parser<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<P, S> Freeze for Message<P, S>
impl<P, S> RefUnwindSafe for Message<P, S>where
P: RefUnwindSafe,
S: RefUnwindSafe,
impl<P, S> Send for Message<P, S>
impl<P, S> Sync for Message<P, S>
impl<P, S> Unpin for Message<P, S>
impl<P, S> UnsafeUnpin for Message<P, S>where
P: UnsafeUnpin,
S: UnsafeUnpin,
impl<P, S> UnwindSafe for Message<P, S>where
P: UnwindSafe,
S: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Input, P> EasyParser<Input> for Pwhere
P: Parser<Stream<Input>> + ?Sized,
Input: Stream,
<Input as StreamOnce>::Token: PartialEq,
<Input as StreamOnce>::Range: PartialEq,
impl<Input, P> EasyParser<Input> for Pwhere
P: Parser<Stream<Input>> + ?Sized,
Input: Stream,
<Input as StreamOnce>::Token: PartialEq,
<Input as StreamOnce>::Range: PartialEq,
Source§fn easy_parse(
&mut self,
input: Input,
) -> Result<(Self::Output, Input), Errors<<Input as StreamOnce>::Token, <Input as StreamOnce>::Range, <Input as StreamOnce>::Position>>where
Input: Stream,
Stream<Input>: StreamOnce<Token = <Input as StreamOnce>::Token, Range = <Input as StreamOnce>::Range, Error = Errors<<Stream<Input> as StreamOnce>::Token, <Stream<Input> as StreamOnce>::Range, <Stream<Input> as StreamOnce>::Position>, Position = <Input as StreamOnce>::Position>,
<Input as StreamOnce>::Position: Default,
Self: Sized + Parser<Stream<Input>>,
fn easy_parse(
&mut self,
input: Input,
) -> Result<(Self::Output, Input), Errors<<Input as StreamOnce>::Token, <Input as StreamOnce>::Range, <Input as StreamOnce>::Position>>where
Input: Stream,
Stream<Input>: StreamOnce<Token = <Input as StreamOnce>::Token, Range = <Input as StreamOnce>::Range, Error = Errors<<Stream<Input> as StreamOnce>::Token, <Stream<Input> as StreamOnce>::Range, <Stream<Input> as StreamOnce>::Position>, Position = <Input as StreamOnce>::Position>,
<Input as StreamOnce>::Position: Default,
Self: Sized + Parser<Stream<Input>>,
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§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