pub struct StatsCollector { /* private fields */ }Expand description
Incrementally accumulates capture statistics in a single streaming pass.
Implementations§
Source§impl StatsCollector
impl StatsCollector
Sourcepub fn new(unidirectional: bool) -> Self
pub fn new(unidirectional: bool) -> Self
Create a new collector.
Set unidirectional = true to compute direction-sensitive flow IDs.
Sourcepub fn feed(
&mut self,
timestamp_ns: u64,
captured_len: u32,
key: Option<FlowKey>,
)
pub fn feed( &mut self, timestamp_ns: u64, captured_len: u32, key: Option<FlowKey>, )
Feed one packet into the collector.
timestamp_ns: packet timestamp in nanoseconds since the Unix epoch.captured_len: number of bytes captured for this packet.key: optional parsed 5-tuple;Nonefor non-IP packets (e.g. ARP).
Sourcepub fn finish(self) -> CaptureInfo
pub fn finish(self) -> CaptureInfo
Consume the collector and produce the final CaptureInfo.
Auto Trait Implementations§
impl Freeze for StatsCollector
impl RefUnwindSafe for StatsCollector
impl Send for StatsCollector
impl Sync for StatsCollector
impl Unpin for StatsCollector
impl UnsafeUnpin for StatsCollector
impl UnwindSafe for StatsCollector
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> 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