pub trait MergerChunk: SizableContainer {
    type TimeOwned;
    type DiffOwned: Default;

    // Required methods
    fn time_kept(
        time1: &Self::Item<'_>,
        upper: &AntichainRef<'_, Self::TimeOwned>,
        frontier: &mut Antichain<Self::TimeOwned>,
    ) -> bool;
    fn push_and_add<'a>(
        &mut self,
        item1: Self::Item<'a>,
        item2: Self::Item<'a>,
        stash: &mut Self::DiffOwned,
    );

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

Behavior to dissect items of chunks in the merge batcher

Required Associated Types§

Source

type TimeOwned

An owned time type.

This type is provided so that users can maintain antichains of something, in order to track the forward movement of time and extract intervals from chains of updates.

Source

type DiffOwned: Default

The owned diff type.

This type is provided so that users can provide an owned instance to the push_and_add method, to act as a scratch space when the type is substantial and could otherwise require allocations.

Required Methods§

Source

fn time_kept( time1: &Self::Item<'_>, upper: &AntichainRef<'_, Self::TimeOwned>, frontier: &mut Antichain<Self::TimeOwned>, ) -> bool

Relates a borrowed time to antichains of owned times.

If upper is less or equal to time, the method returns true and ensures that frontier reflects time.

Source

fn push_and_add<'a>( &mut self, item1: Self::Item<'a>, item2: Self::Item<'a>, stash: &mut Self::DiffOwned, )

Push an entry that adds together two diffs.

This is only called when two items are deemed mergeable by the container queue. If the two diffs added together is zero do not push anything.

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 + 'static, T: Ord + PartialOrder + Clone + 'static, R: Semigroup + 'static> MergerChunk for Vec<(D, T, R)>

Source§

type TimeOwned = T

Source§

type DiffOwned = ()

Source§

fn time_kept( (_, time, _): &Self::Item<'_>, upper: &AntichainRef<'_, Self::TimeOwned>, frontier: &mut Antichain<Self::TimeOwned>, ) -> bool

Source§

fn push_and_add<'a>( &mut self, item1: Self::Item<'a>, item2: Self::Item<'a>, _stash: &mut Self::DiffOwned, )

Source§

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

Implementors§