[][src]Trait pahs::error_accumulator::ErrorAccumulator

pub trait ErrorAccumulator<P, E> {
    type Accumulated;
    pub fn add_err(&mut self, err: E, pos: P);
pub fn finish(self) -> Self::Accumulated; pub fn add_progress<T>(
        &mut self,
        progress: Progress<P, T, E>
    ) -> Progress<P, T, ()>
    where
        P: Clone
, { ... } }

Allows tracking multiple failures encountered in complex parsers or combinators.

Associated Types

type Accumulated[src]

As which type the accumulated errors will be returned (by finish).

Loading content...

Required methods

pub fn add_err(&mut self, err: E, pos: P)[src]

Adds the specified error to the accumulation.

pub fn finish(self) -> Self::Accumulated[src]

Consumes the accumulator, returning the accumulated errors.

Loading content...

Provided methods

pub fn add_progress<T>(
    &mut self,
    progress: Progress<P, T, E>
) -> Progress<P, T, ()> where
    P: Clone
[src]

Consumes and accumulates the error in the specified Progress, if any.

Loading content...

Implementations on Foreign Types

impl<P, E> ErrorAccumulator<P, E> for ()[src]

type Accumulated = ()

Loading content...

Implementors

impl<P, E> ErrorAccumulator<P, E> for AllBestErrorsAccumulator<P, E> where
    P: Pos
[src]

type Accumulated = Vec<E>

impl<P, E> ErrorAccumulator<P, E> for AllErrorsAccumulator<E>[src]

type Accumulated = Vec<E>

impl<P, E> ErrorAccumulator<P, E> for LastErrorOnly<E>[src]

type Accumulated = E

pub fn finish(self) -> Self::Accumulated[src]

Panics if no error was added.

Loading content...