[][src]Trait comb::Scanner

pub trait Scanner {
    type Input;
    type Output;
    fn scan(
        &self,
        stream: &mut Stream<Self::Input>
    ) -> Result<Self::Output, Self::Input>; fn map<T, F>(self, f: F) -> Map<T, Self, F>
    where
        Self: Sized,
        F: Fn(Self::Output) -> T
, { ... }
fn or<T>(self, x: T) -> Or<Self, T>
    where
        Self: Sized,
        T: Scanner<Input = Self::Input, Output = Self::Output>
, { ... }
fn and<T>(self, x: T) -> And<Self, T>
    where
        Self: Sized,
        T: Scanner<Input = Self::Input>
, { ... }
fn skip<T>(self, x: T) -> Skip<Self, T>
    where
        Self: Sized,
        T: Scanner<Input = Self::Input>
, { ... }
fn optional(self) -> Optional<Self>
    where
        Self: Sized
, { ... }
fn then<B, F>(self, f: F) -> Then<Self, F, B>
    where
        Self: Sized,
        F: Fn(Self::Output) -> B,
        B: Scanner<Input = Self::Input>
, { ... }
fn many(self) -> Many<Self>
    where
        Self: Sized
, { ... }
fn many1(self) -> Many<Self>
    where
        Self: Sized
, { ... }
fn many_n(self, n: usize) -> Many<Self>
    where
        Self: Sized
, { ... }
fn with<T>(self, x: T) -> With<Self, T>
    where
        Self: Sized,
        T: Scanner<Input = Self::Input>
, { ... }
fn value<T: Clone>(self, x: T) -> With<Self, Value<T, Self::Input>>
    where
        Self: Sized
, { ... }
fn message(self, msg: Expected<Self::Input>) -> Message<Self>
    where
        Self: Sized,
        Self::Input: Clone
, { ... }
fn attempt(self) -> Attempt<Self>
    where
        Self: Sized
, { ... } }

This trait is the core of the combinatorial sequencing

The scan method must be implemented, it takes a Stream and produces a Result of Self::Output from the Self::Input

Input is the input type

Output is the production type

Associated Types

type Input

type Output

Loading content...

Required methods

fn scan(
    &self,
    stream: &mut Stream<Self::Input>
) -> Result<Self::Output, Self::Input>

Loading content...

Provided methods

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

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>, 

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>, 

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>, 

Skips the next element if it matches the type

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

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>, 

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

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

Repeat the previous combinator until an error is produced

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

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

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

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>, 

Chains two combinators together

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

Produces a value from this sequence

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

Produces an error message at this point in the sequence

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

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

Loading content...

Implementations on Foreign Types

impl<A: Scanner> Scanner for Box<A>[src]

type Input = A::Input

type Output = A::Output

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

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

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

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

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

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]

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

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

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

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

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

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

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

impl<A: Scanner, '_> Scanner for &'_ A[src]

type Input = A::Input

type Output = A::Output

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

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

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

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

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

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]

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

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

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

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

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

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

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

impl<A: Scanner, '_> Scanner for &'_ mut A[src]

type Input = A::Input

type Output = A::Output

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

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

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

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

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

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]

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

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

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

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

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

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

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

Loading content...

Implementors

impl<A, B> Scanner for And<A, B> where
    A: Scanner,
    B: Scanner<Input = A::Input>, 
[src]

type Input = A::Input

type Output = (A::Output, B::Output)

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

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

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

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

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

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]

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

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

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

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

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

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

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

impl<A, B> Scanner for Or<A, B> where
    A: Scanner,
    B: Scanner<Input = A::Input, Output = A::Output>, 
[src]

type Input = A::Input

type Output = B::Output

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

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

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

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

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

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]

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

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

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

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

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

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

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

impl<A, B> Scanner for Skip<A, B> where
    A: Scanner,
    B: Scanner<Input = A::Input>, 
[src]

type Input = A::Input

type Output = A::Output

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

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

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

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

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

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]

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

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

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

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

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

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

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

impl<A, B> Scanner for With<A, B> where
    A: Scanner,
    B: Scanner<Input = A::Input>, 
[src]

type Input = A::Input

type Output = B::Output

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

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

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

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

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

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]

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

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

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

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

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

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

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

impl<A, F, B> Scanner for Then<A, F, B> where
    A: Scanner,
    F: Fn(A::Output) -> B,
    B: Scanner<Input = A::Input>, 
[src]

type Input = A::Input

type Output = B::Output

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

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

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

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

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

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]

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

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

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

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

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

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

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

impl<A: Scanner> Scanner for Attempt<A>[src]

type Input = A::Input

type Output = A::Output

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

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

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

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

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

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]

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

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

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

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

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

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

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

impl<A: Scanner> Scanner for Many<A>[src]

type Input = A::Input

type Output = Vec<A::Output>

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

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

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

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

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

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]

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

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

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

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

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

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

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

impl<A: Scanner> Scanner for Message<A> where
    A::Input: Clone
[src]

type Input = A::Input

type Output = A::Output

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

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

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

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

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

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]

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

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

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

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

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

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

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

impl<A: Scanner> Scanner for Optional<A>[src]

type Input = A::Input

type Output = Option<A::Output>

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

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

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

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

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

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]

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

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

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

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

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

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

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

impl<A: Clone + PartialEq> Scanner for Token<A>[src]

type Input = A

type Output = A

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

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

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

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

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

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]

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

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

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

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

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

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

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

impl<A: Clone + PartialEq> Scanner for Tokens<A>[src]

type Input = A

type Output = Vec<A>

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

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

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

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

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

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]

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

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

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

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

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

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

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

impl<A: Clone, B> Scanner for Fail<A, B>[src]

type Input = A

type Output = B

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

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

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

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

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

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]

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

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

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

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

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

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

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

impl<F, A, B> Scanner for ScanWith<F, A, B> where
    F: Fn(&mut Stream<A>) -> Result<B, A>, 
[src]

type Input = A

type Output = B

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

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

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

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

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

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]

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

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

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

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

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

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

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

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]

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

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

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

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

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]

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

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

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

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

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

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

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

impl<O, T, F> Scanner for Map<O, T, F> where
    T: Scanner,
    F: Fn(T::Output) -> O, 
[src]

type Input = T::Input

type Output = O

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

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

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

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

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

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]

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

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

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

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

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

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

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

impl<T, F> Scanner for Expect<T, F> where
    T: Clone,
    F: Fn(&T) -> bool
[src]

type Input = T

type Output = T

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

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

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

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

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

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]

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

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

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

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

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

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

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

impl<T: Clone> Scanner for Any<T>[src]

type Input = T

type Output = T

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

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

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

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

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

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]

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

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

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

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

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

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

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

impl<T: Clone> Scanner for End<T>[src]

type Input = T

type Output = ()

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

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

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

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

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

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]

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

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

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

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

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

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

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

impl<T: Clone, I> Scanner for Value<T, I>[src]

type Input = I

type Output = T

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

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

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

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

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

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]

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

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

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

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

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

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

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

Loading content...