Struct parser_fuck::combinators::And
source · pub struct And<A, B, I = ()> { /* private fields */ }
Expand description
Only pass if both subparsers pass
Implementations§
Trait Implementations§
source§impl<I: TimeTravel, A, B> Parser<I> for And<A, B, I>where
A: Parser<I>,
B: Parser<I>,
impl<I: TimeTravel, A, B> Parser<I> for And<A, B, I>where A: Parser<I>, B: Parser<I>,
type Output = (<A as Parser<I>>::Output, <B as Parser<I>>::Output)
source§fn map<U, F>(self, f: F) -> Map<Self, I, F>where
Self: Sized,
F: FnMut(Self::Output) -> U,
fn map<U, F>(self, f: F) -> Map<Self, I, F>where Self: Sized, F: FnMut(Self::Output) -> U,
Map a
Parser<Output = T>
to Parser<Output = U>
by applying a function to a contained valuesource§fn and<B>(self, b: B) -> And<Self, B, I>where
Self: Sized,
B: Parser<I>,
fn and<B>(self, b: B) -> And<Self, B, I>where Self: Sized, B: Parser<I>,
Only pass if both subparsers pass
source§fn or<B>(self, b: B) -> Or<Self, B, I>where
Self: Sized,
B: Parser<I, Output = Self::Output>,
fn or<B>(self, b: B) -> Or<Self, B, I>where Self: Sized, B: Parser<I, Output = Self::Output>,
Pass when any subparser passes
source§fn many_min_max(self, min: usize, max: usize) -> Many<Self, I>where
Self: Sized,
fn many_min_max(self, min: usize, max: usize) -> Many<Self, I>where Self: Sized,
{n,m}, >= n && <= m
source§fn and_then<U, F>(self, f: F) -> AndThen<Self, I, F>where
Self: Sized,
U: Parser<I>,
F: FnMut(Self::Output) -> U,
fn and_then<U, F>(self, f: F) -> AndThen<Self, I, F>where Self: Sized, U: Parser<I>, F: FnMut(Self::Output) -> U,
Fail if the subparser fail, otherwise calls f with the new Parser and parse the Parser
source§fn or_else<U, F>(self, f: F) -> OrElse<Self, I, F>where
Self: Sized,
U: Parser<I, Output = Self::Output>,
F: FnMut() -> U,
fn or_else<U, F>(self, f: F) -> OrElse<Self, I, F>where Self: Sized, U: Parser<I, Output = Self::Output>, F: FnMut() -> U,
Pass if subparser pass, otherwise calls f and parse the result Parser
source§fn or_trans<F>(self, no_retry: bool, f: F) -> OrTrans<Self, I, F>where
Self: Sized,
F: FnMut(I, Range<usize>) -> Self::Output,
fn or_trans<F>(self, no_retry: bool, f: F) -> OrTrans<Self, I, F>where Self: Sized, F: FnMut(I, Range<usize>) -> Self::Output,
Pass if subparser pass, otherwise calls f with error point Read more
source§impl<A: PartialEq, B: PartialEq, I: PartialEq> PartialEq for And<A, B, I>
impl<A: PartialEq, B: PartialEq, I: PartialEq> PartialEq for And<A, B, I>
impl<A: Eq, B: Eq, I: Eq> Eq for And<A, B, I>
impl<A, B, I> StructuralEq for And<A, B, I>
impl<A, B, I> StructuralPartialEq for And<A, B, I>
Auto Trait Implementations§
impl<A, B, I> RefUnwindSafe for And<A, B, I>where A: RefUnwindSafe, B: RefUnwindSafe, I: RefUnwindSafe,
impl<A, B, I> Send for And<A, B, I>where A: Send, B: Send, I: Send,
impl<A, B, I> Sync for And<A, B, I>where A: Sync, B: Sync, I: Sync,
impl<A, B, I> Unpin for And<A, B, I>where A: Unpin, B: Unpin, I: Unpin,
impl<A, B, I> UnwindSafe for And<A, B, I>where A: UnwindSafe, B: UnwindSafe, 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