pub trait Builder: Sized {
    type Item;
    type Time: Timestamp;
    type Output;

    // Required methods
    fn with_capacity(keys: usize, vals: usize, upds: usize) -> Self;
    fn copy(&mut self, element: &Self::Item);
    fn done(
        self,
        lower: Antichain<Self::Time>,
        upper: Antichain<Self::Time>,
        since: Antichain<Self::Time>
    ) -> Self::Output;

    // Provided methods
    fn new() -> Self { ... }
    fn push(&mut self, element: Self::Item) { ... }
    fn extend<I: Iterator<Item = Self::Item>>(&mut self, iter: I) { ... }
}
Expand description

Functionality for building batches from ordered update sequences.

Required Associated Types§

source

type Item

Input item type.

source

type Time: Timestamp

Timestamp type.

source

type Output

Output batch type.

Required Methods§

source

fn with_capacity(keys: usize, vals: usize, upds: usize) -> Self

Allocates an empty builder with capacity for the specified keys, values, and updates.

They represent respectively the number of distinct key, (key, val), and total updates.

source

fn copy(&mut self, element: &Self::Item)

Adds an element to the batch.

source

fn done( self, lower: Antichain<Self::Time>, upper: Antichain<Self::Time>, since: Antichain<Self::Time> ) -> Self::Output

Completes building and returns the batch.

Provided Methods§

source

fn new() -> Self

Allocates an empty builder.

Ideally we deprecate this and insist all non-trivial building happens via with_capacity().

source

fn push(&mut self, element: Self::Item)

Adds an element to the batch.

The default implementation uses self.copy with references to the owned arguments. One should override it if the builder can take advantage of owned arguments.

source

fn extend<I: Iterator<Item = Self::Item>>(&mut self, iter: I)

Adds an ordered sequence of elements to the batch.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<B: Builder> Builder for AbomonatedBuilder<B>
where B::Output: Abomonation,

Functionality for building batches from ordered update sequences.

§

type Item = <B as Builder>::Item

§

type Time = <B as Builder>::Time

§

type Output = Abomonated<<B as Builder>::Output, Vec<u8>>

source§

impl<B: Builder> Builder for RcBuilder<B>

Functionality for building batches from ordered update sequences.

§

type Item = <B as Builder>::Item

§

type Time = <B as Builder>::Time

§

type Output = Rc<<B as Builder>::Output>

source§

impl<L: Layout> Builder for OrdKeyBuilder<L>

§

type Item = ((<<L as Layout>::Target as Update>::Key, ()), <<L as Layout>::Target as Update>::Time, <<L as Layout>::Target as Update>::Diff)

§

type Time = <<L as Layout>::Target as Update>::Time

§

type Output = OrdKeyBatch<L>

source§

impl<L: Layout> Builder for OrdValBuilder<L>

§

type Item = ((<<L as Layout>::Target as Update>::Key, <<L as Layout>::Target as Update>::Val), <<L as Layout>::Target as Update>::Time, <<L as Layout>::Target as Update>::Diff)

§

type Time = <<L as Layout>::Target as Update>::Time

§

type Output = OrdValBatch<L>