Skip to main content

GeneratorExt

Trait GeneratorExt 

Source
pub trait GeneratorExt<R>: Generator<R> {
    // Provided methods
    fn receiving<F, U>(self, f: F) -> Receiving<Self, F>
       where Self: Sized,
             F: FnMut(U) -> R { ... }
    fn compose<G: Generator<Self::Yield>>(self, then: G) -> Compose<Self, G>
       where Self: Sized { ... }
    fn map_complete<U, F>(self, f: F) -> MapComplete<Self, F>
       where Self: Sized,
             F: FnOnce(Self::Return) -> U { ... }
    fn map_yield<U, F>(self, f: F) -> MapYield<Self, F>
       where Self: Sized,
             F: FnMut(Self::Yield) -> U { ... }
    fn and_then<G, F>(self, f: F) -> AndThen<Self, F, G>
       where Self: Sized,
             G: Generator<R, Yield = Self::Yield>,
             F: FnOnce(Self::Return) -> G { ... }
    fn flatten(self) -> Flatten<Self, Self::Yield>
       where Self: Sized,
             Self::Yield: Generator<R, Return = ()> { ... }
}

Provided Methods§

Source

fn receiving<F, U>(self, f: F) -> Receiving<Self, F>
where Self: Sized, F: FnMut(U) -> R,

Source

fn compose<G: Generator<Self::Yield>>(self, then: G) -> Compose<Self, G>
where Self: Sized,

Source

fn map_complete<U, F>(self, f: F) -> MapComplete<Self, F>
where Self: Sized, F: FnOnce(Self::Return) -> U,

Source

fn map_yield<U, F>(self, f: F) -> MapYield<Self, F>
where Self: Sized, F: FnMut(Self::Yield) -> U,

Source

fn and_then<G, F>(self, f: F) -> AndThen<Self, F, G>
where Self: Sized, G: Generator<R, Yield = Self::Yield>, F: FnOnce(Self::Return) -> G,

Source

fn flatten(self) -> Flatten<Self, Self::Yield>
where Self: Sized, Self::Yield: Generator<R, Return = ()>,

Implementors§

Source§

impl<G, R> GeneratorExt<R> for G
where G: Generator<R>,