pub struct Stats { /* private fields */ }
Expand description
Contains basic statistics related to a node or a connection.
Implementations§
source§impl Stats
impl Stats
sourcepub fn register_sent_message(&self, size: usize)
pub fn register_sent_message(&self, size: usize)
Registers a sent message of the provided size
in bytes.
note: It’s triggered automatically for the node and every connection
when using the Writing
protocol; it is public in case the user
also wants to collect stats during Handshake::perform_handshake
.
sourcepub fn register_received_message(&self, size: usize)
pub fn register_received_message(&self, size: usize)
Registers a received message of the provided size
in bytes.
note: It’s triggered automatically for the node and every connection
when using the Reading
protocol; it is public in case the user
also wants to collect stats during Handshake::perform_handshake
.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Stats
impl Send for Stats
impl Sync for Stats
impl Unpin 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