pcap_async/
stats.rs

1#[derive(Clone, Debug, Default)]
2pub struct Stats {
3    pub received: u32,
4    pub dropped_by_kernel: u32,
5    pub dropped_by_interface: u32,
6}
7
8impl Stats {
9    pub fn combine(&self, other: &Stats) -> Stats {
10        Stats {
11            received: self.received + other.received,
12            dropped_by_kernel: self.dropped_by_kernel + other.dropped_by_kernel,
13            dropped_by_interface: self.dropped_by_interface + other.dropped_by_interface,
14        }
15    }
16}