Struct som_parser_core::Or
source · pub struct Or<A, B> { /* private fields */ }
Expand description
Tries to apply the first parser, if it fails, it tries to apply the second parser.
Trait Implementations§
source§impl<T, A, B, I> Parser<T, I> for Or<A, B>
impl<T, A, B, I> Parser<T, I> for Or<A, B>
source§fn and<U, P: Parser<U, I>>(self, parser: P) -> And<Self, P>
fn and<U, P: Parser<U, I>>(self, parser: P) -> And<Self, P>
Sequences two parsers, one after the other, collecting both results.
source§fn or<P: Parser<T, I>>(self, parser: P) -> Or<Self, P>
fn or<P: Parser<T, I>>(self, parser: P) -> Or<Self, P>
Tries to apply the first parser, if it fails, it tries to apply the second parser.
source§fn map<F: Fn(T) -> U, U>(self, func: F) -> Map<Self, F, T>
fn map<F: Fn(T) -> U, U>(self, func: F) -> Map<Self, F, T>
Maps a function over the output value of the parser.
Auto Trait Implementations§
impl<A, B> Freeze for Or<A, B>
impl<A, B> RefUnwindSafe for Or<A, B>where
A: RefUnwindSafe,
B: RefUnwindSafe,
impl<A, B> Send for Or<A, B>
impl<A, B> Sync for Or<A, B>
impl<A, B> Unpin for Or<A, B>
impl<A, B> UnwindSafe for Or<A, B>where
A: UnwindSafe,
B: 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