pub struct Maybe<Inner: Parser> { /* private fields */ }
Expand description
Maybe is a combinator returning OptionRepeat
parser with
RepeatSpec::Max(1)
.
Implementations§
Trait Implementations§
Source§impl<R, P: Parser<Result = R>> Parser for Maybe<P>
impl<R, P: Parser<Result = R>> Parser for Maybe<P>
type Result = Option<R>
Source§fn parse(
&mut self,
st: &mut ParseState<impl Iterator<Item = char>>,
) -> ParseResult<Self::Result>
fn parse( &mut self, st: &mut ParseState<impl Iterator<Item = char>>, ) -> ParseResult<Self::Result>
parse consumes input from
st
and returns a result or an error. Read moreAuto Trait Implementations§
impl<Inner> Freeze for Maybe<Inner>where
Inner: Freeze,
impl<Inner> RefUnwindSafe for Maybe<Inner>where
Inner: RefUnwindSafe,
impl<Inner> Send for Maybe<Inner>where
Inner: Send,
impl<Inner> Sync for Maybe<Inner>where
Inner: Sync,
impl<Inner> Unpin for Maybe<Inner>where
Inner: Unpin,
impl<Inner> UnwindSafe for Maybe<Inner>where
Inner: 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