pub trait TupleSummary:
Clone
+ Send
+ 'static {
type Update: ?Sized;
// Required methods
fn create(update: &Self::Update) -> Self;
fn union_combine(&mut self, other: &Self);
fn intersection_combine(&mut self, other: &Self);
}Expand description
A user-defined per-entry summary for TupleSketch.
Implement this on your own type to get a Tuple sketch that carries it.
§Panics and the FFI boundary
union_combine,
intersection_combine, and
Clone::clone are invoked by C++. A panic cannot unwind across that
boundary, and the underlying C++ combine has no way to report failure and
roll back an insert, so a panic in any of those three aborts the
process after printing a diagnostic. Make them total.
create is different: it runs entirely in Rust before any
C++ call, so a panic there is an ordinary Rust panic that propagates to
your caller.
Required Associated Types§
Required Methods§
Sourcefn union_combine(&mut self, other: &Self)
fn union_combine(&mut self, other: &Self)
Merges other into self with union semantics. Used both when a key
is updated more than once and when two sketches are unioned.
Sourcefn intersection_combine(&mut self, other: &Self)
fn intersection_combine(&mut self, other: &Self)
Merges other into self with intersection semantics.
There is deliberately no default: upstream notes that no intersection
policy is sensible in general, and silently reusing union semantics
would be a correctness trap. If union semantics are what you want,
call self.union_combine(other) here explicitly.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".