Skip to main content

Builder

Trait Builder 

Source
pub trait Builder: Default {
    type Input;
    type Time: Timestamp;
    type Output;

    // Required methods
    fn push(&mut self, chunk: &mut Self::Input);
    fn done(self) -> Option<Self::Output>;
}
Expand description

Functionality for building batches from ordered update sequences.

Default is the empty builder; a builder discovers its output as it is pushed, and so has no opportunity to size itself in advance.

Required Associated Types§

Source

type Input

Input item type.

Source

type Time: Timestamp

Timestamp type.

Source

type Output

Output batch type.

Required Methods§

Source

fn push(&mut self, chunk: &mut Self::Input)

Adds a chunk of elements to the batch.

Adds all elements from chunk to the builder and leaves chunk in an undefined state.

Source

fn done(self) -> Option<Self::Output>

Completes building and returns the batch, absent if no updates were pushed.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl<C> Builder for ChunkBatchBuilder<C>
where C: Chunk + Default + 'static, C::Time: Timestamp,

Source§

impl<L, CI> Builder for OrdKeyBuilder<L, CI>
where L: for<'a> Layout<KeyContainer: PushInto<CI::Key<'a>>> + Layout<ValContainer: BatchContainer<Owned: Default>> + Layout, CI: BuilderInput<L::KeyContainer, L::ValContainer, Time = Time<L>, Diff = Diff<L>>,

Source§

impl<L, CI> Builder for OrdValBuilder<L, CI>
where L: for<'a> Layout<KeyContainer: PushInto<CI::Key<'a>>, ValContainer: PushInto<CI::Val<'a>>>, CI: for<'a> BuilderInput<L::KeyContainer, L::ValContainer, Time = Time<L>, Diff = Diff<L>>,