Trait Mode

pub trait Mode

Parser mode: influences how combinators build values

the [Parser] trait is generic over types implementing [Mode]. Its method are called to produce and manipulate output values or errors.

The main implementations of this trait are:

Associated Types

type Output<T>;

The output type that may be generated

Required Methods

fn bind<T, F: FnOnce() -> T>(f: F) -> Self::Output<T>

Produces a value

fn map<T, U, F: FnOnce(T) -> U>(x: Self::Output<T>, f: F) -> Self::Output<U>

Applies a function over the produced value

fn combine<T, U, V, F: FnOnce(T, U) -> V>(x: Self::Output<T>, y: Self::Output<U>, f: F) -> Self::Output<V>

Combines two values generated by previous parsers

Implementors