#[non_exhaustive]pub struct UdpStats {
pub received: u64,
pub sent: u64,
pub dropped: u64,
pub refused: u64,
pub truncated: u64,
pub icmp_errors: u64,
pub overflow: u64,
pub sources: u32,
}Available on crate feature
udp only.Expand description
Counters of one socket since it was bound.
let s = net_io::UdpSocket::bind("127.0.0.1:0")?.stats();
assert_eq!(s.received, 0);Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.received: u64Datagrams returned to the caller.
sent: u64Datagrams sent.
dropped: u64Datagrams read and dropped because their source or the socket was over budget.
refused: u64Sends refused by the amplification guard.
truncated: u64Datagrams returned truncated.
icmp_errors: u64ICMP error reports read from the socket and ignored.
overflow: u64Datagrams from sources that found the table full (the shared overflow budget).
sources: u32Sources tracked now.
Trait Implementations§
impl Copy for UdpStats
impl Eq for UdpStats
impl StructuralPartialEq for UdpStats
Auto Trait Implementations§
impl Freeze for UdpStats
impl RefUnwindSafe for UdpStats
impl Send for UdpStats
impl Sync for UdpStats
impl Unpin for UdpStats
impl UnsafeUnpin for UdpStats
impl UnwindSafe for UdpStats
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