pub struct BandwidthSinks { /* private fields */ }
👎Deprecated: Use
libp2p::SwarmBuilder::with_bandwidth_metrics
or libp2p_metrics::BandwidthTransport
instead.Expand description
Allows obtaining the average bandwidth of the streams.
Implementations§
Source§impl BandwidthSinks
impl BandwidthSinks
Sourcepub fn total_inbound(&self) -> u64
pub fn total_inbound(&self) -> u64
Returns the total number of bytes that have been downloaded on all the streams.
Note: This method is by design subject to race conditions. The returned value should only ever be used for statistics purposes.
Sourcepub fn total_outbound(&self) -> u64
pub fn total_outbound(&self) -> u64
Returns the total number of bytes that have been uploaded on all the streams.
Note: This method is by design subject to race conditions. The returned value should only ever be used for statistics purposes.
Auto Trait Implementations§
impl !Freeze for BandwidthSinks
impl RefUnwindSafe for BandwidthSinks
impl Send for BandwidthSinks
impl Sync for BandwidthSinks
impl Unpin for BandwidthSinks
impl UnwindSafe for BandwidthSinks
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more