[][src]Enum comb::adapters::Either

pub enum Either<L, R> where
    L: Scanner,
    R: Scanner<Input = L::Input, Output = L::Output>, 
{ Left(L), Right(R), }

Left and Right kinds for an Either<L,R> type. This acts as an combinator

Variants

Left(L)Right(R)

Trait Implementations

impl<L, R> Scanner for Either<L, R> where
    L: Scanner,
    R: Scanner<Input = L::Input, Output = L::Output>, 
[src]

type Input = L::Input

type Output = L::Output

fn map<T, F>(self, f: F) -> Map<T, Self, F> where
    Self: Sized,
    F: Fn(Self::Output) -> T, 
[src]

Maps a function over the sequence

fn or<T>(self, x: T) -> Or<Self, T> where
    Self: Sized,
    T: Scanner<Input = Self::Input, Output = Self::Output>, 
[src]

Produces an or squence with the current and next combinator

fn and<T>(self, x: T) -> And<Self, T> where
    Self: Sized,
    T: Scanner<Input = Self::Input>, 
[src]

Produces an and sequence with the current and next combinator

fn skip<T>(self, x: T) -> Skip<Self, T> where
    Self: Sized,
    T: Scanner<Input = Self::Input>, 
[src]

Skips the next element if it matches the type

fn optional(self) -> Optional<Self> where
    Self: Sized
[src]

Produces a sequence where this element is optional

fn then<B, F>(self, f: F) -> Then<Self, F, B> where
    Self: Sized,
    F: Fn(Self::Output) -> B,
    B: Scanner<Input = Self::Input>, 
[src]

When a successful production has happened, run a function producing a new sequence

fn many(self) -> Many<Self> where
    Self: Sized
[src]

Repeat the previous combinator until an error is produced

fn many1(self) -> Many<Self> where
    Self: Sized
[src]

Repeat the previous combinator at least once until an error is produced

fn many_n(self, n: usize) -> Many<Self> where
    Self: Sized
[src]

Repeat the previous combinator at least n times until an error is produced

fn with<T>(self, x: T) -> With<Self, T> where
    Self: Sized,
    T: Scanner<Input = Self::Input>, 
[src]

Chains two combinators together

fn value<T: Clone>(self, x: T) -> With<Self, Value<T, Self::Input>> where
    Self: Sized
[src]

Produces a value from this sequence

fn message(self, msg: Expected<Self::Input>) -> Message<Self> where
    Self: Sized,
    Self::Input: Clone
[src]

Produces an error message at this point in the sequence

fn attempt(self) -> Attempt<Self> where
    Self: Sized
[src]

Try to do the combinator, otherwise rollback to the last successful one

Auto Trait Implementations

impl<L, R> Send for Either<L, R> where
    L: Send,
    R: Send

impl<L, R> Sync for Either<L, R> where
    L: Sync,
    R: Sync

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]