pub trait Batcher<Output>: SizeOfwhere
Output: Batch,{
// Required methods
fn new_batcher(vtables: &Output::Factories, time: Output::Time) -> Self;
fn push_batch(
&mut self,
batch: &mut Box<DynWeightedPairs<DynPair<Output::Key, Output::Val>, Output::R>>,
);
fn push_consolidated_batch(
&mut self,
batch: &mut Box<DynWeightedPairs<DynPair<Output::Key, Output::Val>, Output::R>>,
);
fn tuples(&self) -> usize;
fn seal(self) -> Output;
}Expand description
Functionality for collecting and batching updates.
Required Methods§
Sourcefn new_batcher(vtables: &Output::Factories, time: Output::Time) -> Self
fn new_batcher(vtables: &Output::Factories, time: Output::Time) -> Self
Allocates a new empty batcher. All tuples in the batcher (and its
output batch) will have timestamp time.
Sourcefn push_batch(
&mut self,
batch: &mut Box<DynWeightedPairs<DynPair<Output::Key, Output::Val>, Output::R>>,
)
fn push_batch( &mut self, batch: &mut Box<DynWeightedPairs<DynPair<Output::Key, Output::Val>, Output::R>>, )
Adds an unordered batch of elements to the batcher.
Sourcefn push_consolidated_batch(
&mut self,
batch: &mut Box<DynWeightedPairs<DynPair<Output::Key, Output::Val>, Output::R>>,
)
fn push_consolidated_batch( &mut self, batch: &mut Box<DynWeightedPairs<DynPair<Output::Key, Output::Val>, Output::R>>, )
Adds a consolidated batch of elements to the batcher.
A consolidated batch is sorted and contains no duplicates or zero weights.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".