[][src]Struct libp2prs_swarm::metrics::metric::Metric

pub struct Metric { /* fields omitted */ }

Implementations

impl Metric[src]

pub fn new() -> Metric[src]

Create a new metric

pub fn get_recv_count_and_size(&self) -> (usize, usize)[src]

Get count & bytes about received package

pub fn get_sent_count_and_size(&self) -> (usize, usize)[src]

Get count & bytes about sent package

pub fn get_protocol_in_and_out(
    &self,
    protocol_id: &str
) -> (Option<usize>, Option<usize>)
[src]

Get in&out bytes by protocol_id

pub fn get_peer_in_and_out(
    &self,
    peer_id: &PeerId
) -> (Option<usize>, Option<usize>)
[src]

Get in&out bytes by peer_id

pub fn get_peers_in_list(&self) -> IntoIter<PeerId, usize>[src]

Get an iterator that key is peer_id and value is input bytes.

pub fn get_peers_out_list(&self) -> IntoIter<PeerId, usize>[src]

Get an iterator that key is peer_id and value is output bytes.

pub fn get_protocols_in_list(&self) -> IntoIter<String, usize>[src]

Get an iterator that key is protocol and value is input bytes.

pub fn get_protocols_out_list(&self) -> IntoIter<String, usize>[src]

Get an iterator that key is protocol and value is output bytes.

Trait Implementations

impl Debug for Metric[src]

impl Default for Metric[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T[src]

type Init = T

The type for initializers.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,