Struct eventual::Stream [] [src]

#[must_use = "streams are lazy and do nothing unless consumed"]
pub struct Stream<T: Send + 'static, E: Send + 'static> { /* fields omitted */ }

Methods

impl<T: Send + 'static, E: Send + 'static> Stream<T, E>
[src]

Creates a new Stream, returning it with the associated Sender.

Returns a Stream that will immediately succeed with the supplied value.

use eventual::*;

let stream = Stream::<i32, &'static str>::empty();
assert!(stream.iter().next().is_none());

Asyncronously collects the items from the Stream, returning them sorted by order of arrival.

Synchronously iterate over the Stream

Sequentially yields each value to the supplied function. Returns a future representing the completion of the final yield.

Returns a new stream containing the values of the original stream that match the given predicate.

Returns a new stream representing the application of the specified function to each value of the original stream.

Returns a new stream representing the application of the specified function to each value of the original stream. Each iteration waits for the async result of the mapping to realize before continuing on to the next value.

Returns a new stream with an identical sequence of values as the original. If the original stream errors, apply the given function on the error and use the result as the error of the new stream.

Aggregate all the values of the stream by applying the given function to each value and the result of the previous application. The first iteration is seeded with the given initial value.

Returns a future that will be completed with the result of the final iteration.

Aggregate all the values of the stream by applying the given function to each value and the realized result of the previous application. The first iteration is seeded with the given initial value.

Returns a future that will be completed with the result of the final iteration.

Returns a stream representing the n first values of the original stream.

Trait Implementations

impl<T: Send + 'static, E: Send + 'static> Async for Stream<T, E>
[src]

Returns true if expect will succeed.

Returns true if the async value is ready and has failed

Get the underlying value if present

Invokes the given function when the Async instance is ready to be consumed. Read more

Blocks the thread until the async value is complete and returns the result. Read more

Get the underlying value if present, panic otherwise

Invoke the callback with the resolved Async result.

Trigger the computation without waiting for the result

This method returns a future whose completion value depends on the completion value of the original future. Read more

This method returns a future whose completion value depends on the completion value of the original future. Read more

This method returns a future whose completion value depends on the completion value of the original future. Read more

This method returns a future whose completion value depends on the completion value of the original future. Read more

impl<T: Send + 'static, E: Send + 'static> Pair for Stream<T, E>
[src]

impl<T: Send + 'static, E: Send + 'static> Debug for Stream<T, E>
[src]

Formats the value using the given formatter.

impl<T: Send + 'static, E: Send + 'static> Drop for Stream<T, E>
[src]

A method called when the value goes out of scope. Read more