Trait libp2p::TransportExt
source · pub trait TransportExt: Transport {
// Provided method
fn with_bandwidth_logging(
self
) -> (BandwidthLogging<Self>, Arc<BandwidthSinks>)
where Self: Sized { ... }
}
Expand description
Trait automatically implemented on all objects that implement Transport
. Provides some
additional utilities.
Provided Methods§
sourcefn with_bandwidth_logging(self) -> (BandwidthLogging<Self>, Arc<BandwidthSinks>)where
Self: Sized,
fn with_bandwidth_logging(self) -> (BandwidthLogging<Self>, Arc<BandwidthSinks>)where Self: Sized,
Adds a layer on the Transport
that logs all trafic that passes through the sockets
created by it.
This method returns an Arc<BandwidthSinks>
that can be used to retreive the total number
of bytes transferred through the sockets.