Struct libp2p_swarm::NetworkInfo
source · pub struct NetworkInfo { /* private fields */ }
Expand description
Information about the connections obtained by Swarm::network_info()
.
Implementations§
source§impl NetworkInfo
impl NetworkInfo
sourcepub fn num_peers(&self) -> usize
pub fn num_peers(&self) -> usize
The number of connected peers, i.e. peers with whom at least one established connection exists.
sourcepub fn connection_counters(&self) -> &ConnectionCounters
pub fn connection_counters(&self) -> &ConnectionCounters
Gets counters for ongoing network connections.
Trait Implementations§
source§impl Clone for NetworkInfo
impl Clone for NetworkInfo
source§fn clone(&self) -> NetworkInfo
fn clone(&self) -> NetworkInfo
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl RefUnwindSafe for NetworkInfo
impl Send for NetworkInfo
impl Sync for NetworkInfo
impl Unpin for NetworkInfo
impl UnwindSafe for NetworkInfo
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