pub struct CounterStats {
pub received: u64,
pub duplicates: u64,
pub missed: u64,
pub resets: u64,
}Available on crate feature
std only.Expand description
Counts derived from the one byte message counters.
Counters are tracked per message type for single messages (Bluetooth 4
keeps one counter per type) and once for packs. A repeat of the last
counter value counts as a duplicate; a jump forward of n counts n - 1
missed frames, and a late frame inside the reorder window takes one back.
Transmitters may legally repeat a counter when content is
unchanged, so missed is an estimate of lost frames, not an exact count.
Fields§
§received: u64Frames accepted.
duplicates: u64Frames whose counter repeated the previous one.
missed: u64Frames estimated lost from forward counter jumps.
resets: u64Times the counter went backwards by more than the reorder window (treated as a transmitter restart).
Implementations§
Source§impl CounterStats
impl CounterStats
Sourcepub fn loss_ratio(&self) -> f64
pub fn loss_ratio(&self) -> f64
missed / (received + missed), or 0 before any frame.
Trait Implementations§
Source§impl Clone for CounterStats
impl Clone for CounterStats
impl Copy for CounterStats
Source§impl Debug for CounterStats
impl Debug for CounterStats
Source§impl Default for CounterStats
impl Default for CounterStats
impl Eq for CounterStats
Source§impl PartialEq for CounterStats
impl PartialEq for CounterStats
impl StructuralPartialEq for CounterStats
Auto Trait Implementations§
impl Forget for CounterStats
impl Freeze for CounterStats
impl Move for CounterStats
impl RefUnwindSafe for CounterStats
impl Send for CounterStats
impl Sync for CounterStats
impl Unpin for CounterStats
impl UnsafeUnpin for CounterStats
impl UnwindSafe for CounterStats
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