pub struct HopStats {
pub packets_forwarded: AtomicU64,
pub packets_dropped: AtomicU64,
pub bytes_forwarded: AtomicU64,
/* private fields */
}Expand description
Per-hop statistics
Fields§
§packets_forwarded: AtomicU64Packets forwarded
packets_dropped: AtomicU64Packets dropped (TTL, no route, etc.)
bytes_forwarded: AtomicU64Bytes forwarded
Implementations§
Source§impl HopStats
impl HopStats
Sourcepub fn record_forward(&self, bytes: u64, latency_ns: u64)
pub fn record_forward(&self, bytes: u64, latency_ns: u64)
Record a forwarded packet
Sourcepub fn record_drop(&self)
pub fn record_drop(&self)
Record a dropped packet
Sourcepub fn avg_latency_ns(&self) -> u64
pub fn avg_latency_ns(&self) -> u64
Get average forwarding latency in nanoseconds
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for HopStats
impl RefUnwindSafe for HopStats
impl Send for HopStats
impl Sync for HopStats
impl Unpin for HopStats
impl UnsafeUnpin for HopStats
impl UnwindSafe for HopStats
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