pub struct KnownPeers(/* private fields */);
Expand description
Contains statistics related to Tcp’s peers, currently connected or not.
Implementations§
Source§impl KnownPeers
impl KnownPeers
Sourcepub fn remove(&self, addr: IpAddr) -> Option<Arc<Stats>>
pub fn remove(&self, addr: IpAddr) -> Option<Arc<Stats>>
Removes an address from the list of known peers.
Sourcepub fn snapshot(&self) -> HashMap<IpAddr, Arc<Stats>>
pub fn snapshot(&self) -> HashMap<IpAddr, Arc<Stats>>
Returns the list of all known peers and their stats.
Sourcepub fn register_sent_message(&self, to: IpAddr, size: usize)
pub fn register_sent_message(&self, to: IpAddr, size: usize)
Registers a submission of a message to the given address.
Sourcepub fn register_received_message(&self, from: IpAddr, size: usize)
pub fn register_received_message(&self, from: IpAddr, size: usize)
Registers a receipt of a message to the given address.
Sourcepub fn register_failure(&self, addr: IpAddr)
pub fn register_failure(&self, addr: IpAddr)
Registers a failure associated with the given address.
Trait Implementations§
Source§impl Default for KnownPeers
impl Default for KnownPeers
Source§fn default() -> KnownPeers
fn default() -> KnownPeers
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for KnownPeers
impl !RefUnwindSafe for KnownPeers
impl Send for KnownPeers
impl Sync for KnownPeers
impl Unpin for KnownPeers
impl !UnwindSafe for KnownPeers
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