pub trait Store:
Clone
+ Send
+ Sync {
// Required methods
fn add(&mut self, index: i32, count: u64);
fn total_count(&self) -> u64;
fn min_index(&self) -> Option<i32>;
fn max_index(&self) -> Option<i32>;
fn key_at_rank(&self, rank: u64) -> Option<i32>;
fn merge(&mut self, other: &Self);
fn is_empty(&self) -> bool;
fn clear(&mut self);
fn merge_from_proto(
&mut self,
proto: &ProtoStore,
) -> Result<(), ProtoConversionError>;
fn to_proto(&self) -> ProtoStore;
}Expand description
Storage for sketch observations.
Stores manage holding the counts of mapped values, such that they contain a list of bins and the number of observations currently counted in each bin.
Required Methods§
Sourcefn total_count(&self) -> u64
fn total_count(&self) -> u64
Returns the total count across all bins.
Sourcefn min_index(&self) -> Option<i32>
fn min_index(&self) -> Option<i32>
Returns the minimum index with a non-zero count, or None if empty.
Sourcefn max_index(&self) -> Option<i32>
fn max_index(&self) -> Option<i32>
Returns the maximum index with a non-zero count, or None if empty.
Sourcefn key_at_rank(&self, rank: u64) -> Option<i32>
fn key_at_rank(&self, rank: u64) -> Option<i32>
Returns the index of the bin containing the given rank.
The rank is 0-indexed, so rank 0 is the first observation.
Sourcefn merge_from_proto(
&mut self,
proto: &ProtoStore,
) -> Result<(), ProtoConversionError>
fn merge_from_proto( &mut self, proto: &ProtoStore, ) -> Result<(), ProtoConversionError>
Populates this store from a protobuf Store.
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.