pub struct Counts<T> {
pub received_bytes: T,
pub send_bytes: T,
pub received_pkts: T,
pub send_pkts: T,
pub error_pkts: T,
}
Expand description
Worker independent statisticsing statistics
Fields§
§received_bytes: T
§send_bytes: T
§received_pkts: T
§send_pkts: T
§error_pkts: T
Implementations§
Source§impl<T: Number> Counts<T>
impl<T: Number> Counts<T>
Sourcepub fn add(&self, payload: &Stats)
pub fn add(&self, payload: &Stats)
§Example
use turn_server::statistics::*;
let counts = Counts {
received_bytes: Count::default(),
send_bytes: Count::default(),
received_pkts: Count::default(),
send_pkts: Count::default(),
error_pkts: Count::default(),
};
counts.add(&Stats::ReceivedBytes(1));
assert_eq!(counts.received_bytes.get(), 1);
counts.add(&Stats::ReceivedPkts(1));
assert_eq!(counts.received_pkts.get(), 1);
counts.add(&Stats::SendBytes(1));
assert_eq!(counts.send_bytes.get(), 1);
counts.add(&Stats::SendPkts(1));
assert_eq!(counts.send_pkts.get(), 1);
Auto Trait Implementations§
impl<T> Freeze for Counts<T>where
T: Freeze,
impl<T> RefUnwindSafe for Counts<T>where
T: RefUnwindSafe,
impl<T> Send for Counts<T>where
T: Send,
impl<T> Sync for Counts<T>where
T: Sync,
impl<T> Unpin for Counts<T>where
T: Unpin,
impl<T> UnwindSafe for Counts<T>where
T: UnwindSafe,
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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