pub trait MergeEstimationLogic: EstimationLogic {
type Helper;
// Required methods
fn new_helper(&self) -> Self::Helper;
fn merge_with_helper(
&self,
dst: &mut Self::Backend,
src: &Self::Backend,
helper: &mut Self::Helper,
);
// Provided method
fn merge(&self, dst: &mut Self::Backend, src: &Self::Backend) { ... }
}
Expand description
An extension of EstimationLogic
providing methods to merge backends.
Some kind of estimators make available a merge operation, which, given two estimators, returns an estimator with the same state one would obtain by adding to an empty estimator all the elements added to the two estimators, computing, in practice, a set union.
Required Associated Types§
Sourcetype Helper
type Helper
The type of the helper use in merge calculations.
Merge calculation might require temporary allocations. To mitigate excessive allocation, it is possible to obtain a helper and reusing it for several merge operations
Required Methods§
Sourcefn new_helper(&self) -> Self::Helper
fn new_helper(&self) -> Self::Helper
Creates a new helper to use in merge operations.
Sourcefn merge_with_helper(
&self,
dst: &mut Self::Backend,
src: &Self::Backend,
helper: &mut Self::Helper,
)
fn merge_with_helper( &self, dst: &mut Self::Backend, src: &Self::Backend, helper: &mut Self::Helper, )
Merges src
into dst
using the provided helper to avoid allocations.
Provided Methods§
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.