Trait Grinder

Source
pub trait Grinder {
    type Item: Chisel;
    type Error;

    // Required methods
    fn next(&mut self) -> Self::Item;
    fn emit(&mut self, err: Self::Error);

    // Provided methods
    fn vent<F, E>(self, f: F) -> Vent<Self, F, E>
       where Self: Sized,
             F: Fn(E) { ... }
    fn unwrap(self) -> Unwrap<Self>
       where Self: Sized { ... }
    fn map_err<F, E>(self, f: F) -> MapErrGrinder<Self, F, E>
       where Self: Sized,
             F: Fn(E) -> Self::Error { ... }
    fn peekable(self) -> Peekable<Self>
       where Self: Sized { ... }
    fn lookaheadable(self) -> Lookahead<Self>
       where Self: Sized { ... }
    fn filter<F>(self, f: F) -> Filter<Self, F>
       where Self: Sized,
             F: Fn(&<Self::Item as Chisel>::Value) -> bool { ... }
}

Required Associated Types§

Required Methods§

Source

fn next(&mut self) -> Self::Item

Source

fn emit(&mut self, err: Self::Error)

Provided Methods§

Source

fn vent<F, E>(self, f: F) -> Vent<Self, F, E>
where Self: Sized, F: Fn(E),

Source

fn unwrap(self) -> Unwrap<Self>
where Self: Sized,

Source

fn map_err<F, E>(self, f: F) -> MapErrGrinder<Self, F, E>
where Self: Sized, F: Fn(E) -> Self::Error,

Source

fn peekable(self) -> Peekable<Self>
where Self: Sized,

Source

fn lookaheadable(self) -> Lookahead<Self>
where Self: Sized,

Source

fn filter<F>(self, f: F) -> Filter<Self, F>
where Self: Sized, F: Fn(&<Self::Item as Chisel>::Value) -> bool,

Trait Implementations§

Source§

impl<I, C: Chisel<Value = I>, E> Iterator for dyn Grinder<Item = C, Error = E>

Source§

type Item = I

The type of the elements being iterated over.
Source§

fn next(&mut self) -> Option<I>

Advances the iterator and returns the next value. Read more
1.0.0 · Source§

fn size_hint(&self) -> (usize, Option<usize>)

Returns the bounds on the remaining length of the iterator. Read more
Source§

fn advance_by(&mut self, n: usize) -> Result<(), NonZero<usize>>

🔬This is a nightly-only experimental API. (iter_advance_by)
Advances the iterator by n elements. Read more
1.0.0 · Source§

fn nth(&mut self, n: usize) -> Option<Self::Item>

Returns the nth element of the iterator. Read more

Implementors§

Source§

impl<I, E, C, T> Grinder for Unwrap<T>
where C: Chisel<Value = Result<I, E>>, T: Grinder<Item = C, Error = E>,

Source§

impl<I: Iterator> Grinder for Iter<I>

Source§

impl<R: Read> Grinder for Read<R>

Source§

impl<T> Grinder for Lookahead<T>
where T: Grinder,

Source§

type Item = <T as Grinder>::Item

Source§

type Error = <T as Grinder>::Error

Source§

impl<T> Grinder for Peekable<T>
where T: Grinder,

Source§

type Item = <T as Grinder>::Item

Source§

type Error = <T as Grinder>::Error

Source§

impl<T> Grinder for Utf8<T>
where T: Grinder<Item = Option<u8>>,

Source§

impl<T, E, F> Grinder for MapErrGrinder<T, F, E>
where T: Grinder, F: Fn(E) -> T::Error,

Source§

type Item = <T as Grinder>::Item

Source§

type Error = E

Source§

impl<T, F> Grinder for Filter<T, F>
where T: Grinder, F: Fn(&<T::Item as Chisel>::Value) -> bool,

Source§

type Item = <T as Grinder>::Item

Source§

type Error = <T as Grinder>::Error

Source§

impl<T: Grinder, E, F> Grinder for Vent<T, F, E>
where F: Fn(E),

Source§

type Item = <T as Grinder>::Item

Source§

type Error = E