#[non_exhaustive]pub struct Stats {Show 13 fields
pub open: u64,
pub accepted: u64,
pub refused: u64,
pub closed: u64,
pub bytes_in: u64,
pub bytes_out: u64,
pub egress_denied: u64,
pub killed: u64,
pub slow_peers: u64,
pub timeouts: u64,
pub descriptor_pressure: u64,
pub stale_completions: u64,
pub session_panics: u64,
/* private fields */
}Expand description
Counters summed over the workers.
let server = net_io::serve("127.0.0.1:0", |_c| Ok(()))?;
let stats = server.stats();
println!("{} open, {} accepted", stats.open, stats.accepted);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.open: u64Connections open now.
accepted: u64Connections accepted.
refused: u64Connections refused.
closed: u64Connections closed.
bytes_in: u64Bytes received.
bytes_out: u64Bytes sent.
egress_denied: u64Writes the gate denied.
killed: u64Connections killed.
slow_peers: u64Connections closed for the minimum rate.
timeouts: u64Connections closed by a timeout.
descriptor_pressure: u64Times the process ran out of descriptors.
stale_completions: u64Completions for connections that had closed.
session_panics: u64Sessions that panicked.
Implementations§
Source§impl Stats
impl Stats
Sourcepub fn refused_for(&self, cause: RefusalCause) -> u64
pub fn refused_for(&self, cause: RefusalCause) -> u64
Refusals with this cause (gate codes summed).
Sourcepub fn closed_for(&self, reason: CloseReason) -> u64
pub fn closed_for(&self, reason: CloseReason) -> u64
Closes with this reason’s variant (inner values ignored).
Trait Implementations§
impl Copy for Stats
impl Eq for Stats
impl StructuralPartialEq for Stats
Auto Trait Implementations§
impl Freeze for Stats
impl RefUnwindSafe for Stats
impl Send for Stats
impl Sync for Stats
impl Unpin for Stats
impl UnsafeUnpin for Stats
impl UnwindSafe for Stats
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