#[non_exhaustive]pub struct NetdevStats {
pub in_octets: Option<u64>,
pub out_octets: Option<u64>,
pub in_errors: Option<u64>,
pub out_errors: Option<u64>,
pub in_discards: Option<u64>,
pub out_discards: Option<u64>,
pub in_multicast_pkts: Option<u64>,
pub in_pkts: Option<u64>,
pub out_pkts: Option<u64>,
pub qdisc_backlog_bytes: Option<u64>,
pub qdisc_backlog_pkts: Option<u64>,
}Expand description
A network interface’s counters (#130), with RFC 8343’s names where Linux keeps exactly that counter and nothing else.
in_pkts and out_pkts are not RFC 8343’s: the RFC splits packets by
unicast, multicast and broadcast, Linux’s rx_packets includes multicast,
and Linux keeps no broadcast counter. They are here because an operator
asks for them; the registry says what they are.
#[non_exhaustive] since 0.3; built with NetdevStats::new and the
setters, or Default.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.in_octets: Option<u64>rx_bytes — RFC 8343 in-octets.
out_octets: Option<u64>tx_bytes — RFC 8343 out-octets.
in_errors: Option<u64>rx_errors — RFC 8343 in-errors.
out_errors: Option<u64>tx_errors — RFC 8343 out-errors.
in_discards: Option<u64>rx_dropped — RFC 8343 in-discards.
out_discards: Option<u64>tx_dropped — RFC 8343 out-discards.
in_multicast_pkts: Option<u64>multicast — RFC 8343 in-multicast-pkts.
in_pkts: Option<u64>rx_packets — not RFC 8343: unicast and multicast together.
out_pkts: Option<u64>tx_packets — not RFC 8343.
qdisc_backlog_bytes: Option<u64>Bytes queued in the interface’s queue discipline now, not yet sent (#136). Not a sysfs counter: read over netlink, and only from the kernel’s own interface. The queue an operator watches form when a bearer is slower than what is offered to it.
qdisc_backlog_pkts: Option<u64>Packets queued in the queue discipline now (#136).
Implementations§
Source§impl NetdevStats
impl NetdevStats
Sourcepub fn out_octets(self, n: u64) -> Self
pub fn out_octets(self, n: u64) -> Self
With out_octets.
Sourcepub fn out_errors(self, n: u64) -> Self
pub fn out_errors(self, n: u64) -> Self
With out_errors.
Sourcepub fn in_discards(self, n: u64) -> Self
pub fn in_discards(self, n: u64) -> Self
With in_discards.
Sourcepub fn out_discards(self, n: u64) -> Self
pub fn out_discards(self, n: u64) -> Self
With out_discards.
Sourcepub fn in_multicast_pkts(self, n: u64) -> Self
pub fn in_multicast_pkts(self, n: u64) -> Self
With in_multicast_pkts.
Sourcepub fn qdisc_backlog_bytes(self, n: u64) -> Self
pub fn qdisc_backlog_bytes(self, n: u64) -> Self
With qdisc_backlog_bytes.
Sourcepub fn qdisc_backlog_pkts(self, n: u64) -> Self
pub fn qdisc_backlog_pkts(self, n: u64) -> Self
With qdisc_backlog_pkts.