Skip to main content

ToStreamBuilder

Trait ToStreamBuilder 

Source
pub trait ToStreamBuilder {
    type Item;

    // Required method
    fn to_stream_with_builder<'scope, T: Timestamp, CB>(
        self,
        scope: Scope<'scope, T>,
    ) -> Stream<'scope, T, CB::Container>
       where CB: PushInto<Self::Item> + ContainerBuilder;
}
Expand description

Converts to a timely Stream, using a container builder.

Required Associated Types§

Source

type Item

The item type produced by this iterator-like source.

Required Methods§

Source

fn to_stream_with_builder<'scope, T: Timestamp, CB>( self, scope: Scope<'scope, T>, ) -> Stream<'scope, T, CB::Container>
where CB: PushInto<Self::Item> + ContainerBuilder,

Converts to a timely Stream, using the supplied container builder type.

§Examples
use timely::dataflow::operators::core::{ToStreamBuilder, Capture};
use timely::dataflow::operators::core::capture::Extract;
use timely::container::CapacityContainerBuilder;

let (data1, data2) = timely::example(|scope| {
    let data1 = (0..3).to_stream_with_builder::<_, CapacityContainerBuilder<_>>(scope)
        .container::<Vec<_>>()
        .capture();
    let data2 = vec![0,1,2].to_stream_with_builder::<_, CapacityContainerBuilder<_>>(scope)
        .container::<Vec<_>>()
        .capture();
    (data1, data2)
});

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

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<I: IntoIterator + 'static> ToStreamBuilder for I