pub struct NewLine<I>(/* private fields */)
where
I: Stream<Item = char>;
Trait Implementations§
Source§impl<I> Parser for NewLine<I>
impl<I> Parser for NewLine<I>
Source§type Input = I
type Input = I
A type implementing the
Stream
trait which is the specific type
that is parsed.Source§type Output = <Expected<Satisfy<I, fn(char) -> bool>> as Parser>::Output
type Output = <Expected<Satisfy<I, fn(char) -> bool>> as Parser>::Output
The type which is returned when the parsing is successful.
Source§fn parse_lazy(
&mut self,
input: State<<Self as Parser>::Input>,
) -> ParseResult<<Self as Parser>::Output, <Self as Parser>::Input>
fn parse_lazy( &mut self, input: State<<Self as Parser>::Input>, ) -> ParseResult<<Self as Parser>::Output, <Self as Parser>::Input>
Specialized version of parse_state where the parser does not need to add an error to the
ParseError
when it does not consume any input before encountering the error.
Instead the error can be added later through the add_error
methodSource§fn add_error(&mut self, errors: &mut ParseError<<Self::Input as Stream>::Item>)
fn add_error(&mut self, errors: &mut ParseError<<Self::Input as Stream>::Item>)
Adds the first error that would normally be returned by this parser if it failed
Auto Trait Implementations§
impl<I> Freeze for NewLine<I>
impl<I> RefUnwindSafe for NewLine<I>where
I: RefUnwindSafe,
impl<I> Send for NewLine<I>where
I: Send,
impl<I> Sync for NewLine<I>where
I: Sync,
impl<I> Unpin for NewLine<I>where
I: Unpin,
impl<I> UnwindSafe for NewLine<I>where
I: 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<P> ParserExt for Pwhere
P: Parser,
impl<P> ParserExt for Pwhere
P: Parser,
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) -> And<Self, P2>
fn and<P2>(self, p: P2) -> And<Self, P2>
Parses with
self
followed by p
Succeds if both parsers succed, otherwise fails
Returns a tuple with both values on success 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 expected<S>(self, msg: S) -> Expected<Self>
fn expected<S>(self, msg: S) -> Expected<Self>
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