Struct flo_stream::GeneratorStream[][src]

pub struct GeneratorStream<TFuture, TItem> { /* fields omitted */ }

A generator stream is a stream that runs a Future internally that generates multiple results, which are formatted as a stream. The stream is closed when the future terminates.

Implementations

impl<'a, TFuture, TItem> GeneratorStream<TFuture, TItem> where
    TFuture: 'a + Future<Output = ()>,
    TItem: 'a + Send
[src]

pub fn generate<TFutureFn: FnOnce(Box<dyn Send + Sync + Fn(TItem) -> BoxFuture<'static, ()> + 'a>) -> TFuture>(
    start_future: TFutureFn
) -> GeneratorStream<TFuture, TItem>
[src]

Creates a new generator stream

The function passed in receives the 'yield' function as a parameter

Trait Implementations

impl<TFuture, TItem> Stream for GeneratorStream<TFuture, TItem> where
    TItem: Send,
    TFuture: Future<Output = ()>, 
[src]

type Item = TItem

Values yielded by the stream.

Auto Trait Implementations

impl<TFuture, TItem> RefUnwindSafe for GeneratorStream<TFuture, TItem> where
    TFuture: RefUnwindSafe
[src]

impl<TFuture, TItem> Send for GeneratorStream<TFuture, TItem> where
    TFuture: Send,
    TItem: Send
[src]

impl<TFuture, TItem> Sync for GeneratorStream<TFuture, TItem> where
    TFuture: Sync,
    TItem: Send
[src]

impl<TFuture, TItem> Unpin for GeneratorStream<TFuture, TItem>[src]

impl<TFuture, TItem> UnwindSafe for GeneratorStream<TFuture, TItem> where
    TFuture: UnwindSafe
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> StreamExt for T where
    T: Stream + ?Sized

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<S, T, E> TryStream for S where
    S: Stream<Item = Result<T, E>> + ?Sized

type Ok = T

The type of successful values yielded by this future

type Error = E

The type of failures yielded by this future

impl<S> TryStreamExt for S where
    S: TryStream + ?Sized