Skip to main content

Merger

Trait Merger 

Source
pub trait Merger: Default {
    type Chunk: Default;

    // Required methods
    fn merge(
        &mut self,
        list1: Vec<Self::Chunk>,
        list2: Vec<Self::Chunk>,
        output: &mut Vec<Self::Chunk>,
        stash: &mut Vec<Self::Chunk>,
    );
    fn len(chunk: &Self::Chunk) -> usize;

    // Provided method
    fn allocation(_chunk: &Self::Chunk) -> (usize, usize, usize) { ... }
}
Expand description

A trait to describe interesting moments in a merge ladder.

Required Associated Types§

Source

type Chunk: Default

The internal representation of chunks of data.

Required Methods§

Source

fn merge( &mut self, list1: Vec<Self::Chunk>, list2: Vec<Self::Chunk>, output: &mut Vec<Self::Chunk>, stash: &mut Vec<Self::Chunk>, )

Merge chains into an output chain.

Source

fn len(chunk: &Self::Chunk) -> usize

The number of updates in a chunk.

Drives the geometric ladder (chains are weighed by summed updates, not chunk counts, since regrading decouples the two) and the records field of the size logger.

Provided Methods§

Source

fn allocation(_chunk: &Self::Chunk) -> (usize, usize, usize)

Backing-allocation figures for a chunk: (size, capacity, allocations), for the size logger’s memory telemetry.

Defaults to zero — most chunk types do not track this. Override to report real figures (e.g. Materialize’s memory accounting).

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl<C> Merger for ChunkMerger<C>
where C: Chunk + Default + 'static, C::Time: Clone + PartialOrder + 'static,

Source§

type Chunk = C

Source§

impl<D, T, R> Merger for VecMerger<D, T, R>
where D: Ord + Clone + 'static, T: Ord + Clone + PartialOrder + 'static, R: Semigroup + 'static,