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,
position: &mut usize,
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§
Required Methods§
Sourcefn merge_from(&mut self, others: &mut [Self], positions: &mut [usize])
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
Sourcefn extract(
&mut self,
position: &mut usize,
upper: AntichainRef<'_, Self::TimeOwned>,
frontier: &mut Antichain<Self::TimeOwned>,
keep: &mut Self,
ship: &mut Self,
)
fn extract( &mut self, position: &mut usize, 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.
Iteration starts at *position and advances *position as updates
are consumed. The implementation must yield (return early) when
either keep.at_capacity() or ship.at_capacity() becomes true,
so the caller can swap out a full output buffer and resume by
calling extract again. The caller invokes extract repeatedly
until *position >= self.len().
This shape exists because at_capacity() for Vec is
len() == capacity(), which silently becomes false again the
moment a push past capacity grows the backing allocation.
Without per-element yielding, a single extract call can
quietly produce oversized output chunks.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".