Trait timely::dataflow::operators::to_stream::ToStreamAsync[][src]

pub trait ToStreamAsync<T: Timestamp, D: Data> {
    fn to_stream<S: Scope<Timestamp = T>>(
        self: Pin<Box<Self>>,
        scope: &S
    ) -> Stream<S, D>; }

Converts to a timely Stream.

Required methods

fn to_stream<S: Scope<Timestamp = T>>(
    self: Pin<Box<Self>>,
    scope: &S
) -> Stream<S, D>
[src]

Converts a native Stream of Events into a timely Stream.

Examples

use futures_util::stream;

use timely::dataflow::operators::{Capture, Event, ToStream, ToStreamAsync};
use timely::dataflow::operators::capture::Extract;

let native_stream = stream::iter(vec![
    Event::Message(0, 0),
    Event::Message(0, 1),
    Event::Message(0, 2),
    Event::Progress(Some(0)),
]);

let native_stream = Box::pin(native_stream);

let (data1, data2) = timely::example(|scope| {
    let data1 = native_stream.to_stream(scope).capture();
    let data2 = vec![0,1,2].to_stream(scope).capture();

    (data1, data2)
});

assert_eq!(data1.extract(), data2.extract());
Loading content...

Implementors

impl<T, D, F, I: ?Sized> ToStreamAsync<T, D> for I where
    D: Data,
    T: Timestamp,
    F: IntoIterator<Item = T>,
    I: Stream<Item = Event<F, D>> + 'static, 
[src]

Loading content...