Struct libp2p::swarm::NetworkInfo
source · [−]pub struct NetworkInfo { /* private fields */ }
Expand description
Information about the connections obtained by Swarm::network_info()
.
Implementations
sourceimpl 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
sourceimpl Clone for NetworkInfo
impl Clone for NetworkInfo
sourcefn clone(&self) -> NetworkInfo
fn clone(&self) -> NetworkInfo
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl RefUnwindSafe for NetworkInfo
impl Send for NetworkInfo
impl Sync for NetworkInfo
impl Unpin for NetworkInfo
impl UnwindSafe for NetworkInfo
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more