pub trait PickyIterator<T: Counter> {
// Required methods
fn pick(
&mut self,
index: usize,
total_count_to_index: u64,
count_at_index: T,
) -> Option<PickMetadata>;
fn more(&mut self, index_to_pick: usize) -> bool;
}Expand description
A trait for designing an subset iterator over values in a Histogram.
Required Methods§
Sourcefn pick(
&mut self,
index: usize,
total_count_to_index: u64,
count_at_index: T,
) -> Option<PickMetadata>
fn pick( &mut self, index: usize, total_count_to_index: u64, count_at_index: T, ) -> Option<PickMetadata>
Return Some if an IterationValue should be emitted at this point.
index is a valid index in the relevant histogram.
This will be called with the same index until it returns None. This enables modes of
iteration that pick different values represented by the same bucket, for instance.
Sourcefn more(&mut self, index_to_pick: usize) -> bool
fn more(&mut self, index_to_pick: usize) -> bool
Should we keep iterating even though the last index with non-zero count has already been picked at least once?
This will be called on every iteration once the last index with non-zero count has been
picked, even if the index was not advanced in the last iteration (because pick() returned
Some).