Skip to main content

InternalMerge

pub trait InternalMerge:
    Accountable
    + SizableContainer
    + Default {
    type TimeOwned;

    // Required methods
    fn len(&self) -> usize;
    fn clear(&mut self);
    fn merge_from(&mut self, others: &mut [Self], positions: &mut [usize]);
    fn extract(
        &mut self,
        upper: AntichainRef<'_, Self::TimeOwned>,
        frontier: &mut Antichain<Self::TimeOwned>,
        keep: &mut Self,
        ship: &mut Self,
    );

    // Provided method
    fn account(&self) -> (usize, usize, usize, usize) { ... }
}
Expand description

A container that supports the operations needed by the merge batcher: merging sorted chains and extracting updates by time.

Required Associated Types§

Source

type TimeOwned

The owned time type, for maintaining antichains.

Required Methods§

Source

fn len(&self) -> usize

The number of items in this container.

Source

fn clear(&mut self)

Clear the container for reuse.

Source

fn merge_from(&mut self, others: &mut [Self], positions: &mut [usize])

Merge items from sorted inputs into self, advancing positions. Merges until self is at capacity or all inputs are exhausted.

Dispatches based on the number of inputs:

  • 0: no-op
  • 1: bulk copy (may swap the input into self)
  • 2: merge two sorted streams
Source

fn extract( &mut self, upper: AntichainRef<'_, Self::TimeOwned>, frontier: &mut Antichain<Self::TimeOwned>, keep: &mut Self, ship: &mut Self, )

Extract updates from self into ship (times not beyond upper) and keep (times beyond upper), updating frontier with kept times.

Provided Methods§

Source

fn account(&self) -> (usize, usize, usize, usize)

Account the allocations behind the chunk.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<D: Ord + Clone + 'static, T: Ord + Clone + PartialOrder + 'static, R: Semigroup + Clone + 'static> InternalMerge for Vec<(D, T, R)>

Source§

type TimeOwned = T

Source§

fn len(&self) -> usize

Source§

fn clear(&mut self)

Source§

fn merge_from(&mut self, others: &mut [Self], positions: &mut [usize])

Source§

fn extract( &mut self, upper: AntichainRef<'_, T>, frontier: &mut Antichain<T>, keep: &mut Self, ship: &mut Self, )

Implementors§

Source§

impl<D, T, R> InternalMerge for TimelyStack<(D, T, R)>
where D: Ord + Columnation + Clone + 'static, T: Ord + Columnation + Clone + PartialOrder + 'static, R: Default + Semigroup + Columnation + Clone + 'static,