pub struct MatchedCounter { /* private fields */ }Expand description
Turns successive SNAPSHOTS of a matched count into MatchedStatus
reports — issue 1972. no_std, no allocation, eight bytes.
A backend that can count its matched peers but has no change counter of its own (zenoh’s graph cache; a DDS backend whose change counters are reset by other readers of the same status) feeds the current count here on every poll, and gets a report only when it moved.
total_count counts INCREASES SEEN between polls. A peer that leaves
and another that joins between two polls nets to no change and is not
counted; upstream’s DDS counter would count the join. A snapshot cannot
do better, and saying so is the honest bound.
Implementations§
Source§impl MatchedCounter
impl MatchedCounter
Sourcepub fn observe(&mut self, current_now: u32) -> Option<MatchedStatus>
pub fn observe(&mut self, current_now: u32) -> Option<MatchedStatus>
Record a snapshot of how many endpoints are matched now. Some with
the report when the count moved, None when it did not.
Trait Implementations§
Source§impl Clone for MatchedCounter
impl Clone for MatchedCounter
Source§fn clone(&self) -> MatchedCounter
fn clone(&self) -> MatchedCounter
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more