pub struct HeavyHitter<K> {
pub rank: u32,
pub key: K,
pub estimate: u64,
pub error: u64,
}Expand description
Scored entry returned by SpaceSaving::top_k. K carries
the caller’s key type so the report keeps the original
identifier (no hash collision on IP addresses, flow tuples,
etc.).
Fields§
§rank: u32Rank in the top-K (0 = highest estimate).
key: KCaller-supplied key.
estimate: u64Frequency estimate (always ≥ true_count).
error: u64Worst-case overestimate (estimate − true_count
upper-bound).
Trait Implementations§
Source§impl<K: Clone> Clone for HeavyHitter<K>
impl<K: Clone> Clone for HeavyHitter<K>
Source§fn clone(&self) -> HeavyHitter<K>
fn clone(&self) -> HeavyHitter<K>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<K: Debug> Debug for HeavyHitter<K>
impl<K: Debug> Debug for HeavyHitter<K>
Source§impl<'de, K> Deserialize<'de> for HeavyHitter<K>where
K: Deserialize<'de>,
impl<'de, K> Deserialize<'de> for HeavyHitter<K>where
K: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<K: PartialEq> PartialEq for HeavyHitter<K>
impl<K: PartialEq> PartialEq for HeavyHitter<K>
Source§impl<K> Serialize for HeavyHitter<K>where
K: Serialize,
impl<K> Serialize for HeavyHitter<K>where
K: Serialize,
impl<K: Eq> Eq for HeavyHitter<K>
impl<K> StructuralPartialEq for HeavyHitter<K>
Auto Trait Implementations§
impl<K> Freeze for HeavyHitter<K>where
K: Freeze,
impl<K> RefUnwindSafe for HeavyHitter<K>where
K: RefUnwindSafe,
impl<K> Send for HeavyHitter<K>where
K: Send,
impl<K> Sync for HeavyHitter<K>where
K: Sync,
impl<K> Unpin for HeavyHitter<K>where
K: Unpin,
impl<K> UnsafeUnpin for HeavyHitter<K>where
K: UnsafeUnpin,
impl<K> UnwindSafe for HeavyHitter<K>where
K: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more