Struct ntap_core::net::traffic::TrafficInfo
source · pub struct TrafficInfo {
pub packet_sent: usize,
pub packet_received: usize,
pub bytes_sent: usize,
pub bytes_received: usize,
pub egress_packets_per_sec: usize,
pub egress_bytes_per_sec: usize,
pub ingress_packets_per_sec: usize,
pub ingress_bytes_per_sec: usize,
pub first_seen: SystemTime,
pub last_seen: SystemTime,
}
Fields§
§packet_sent: usize
§packet_received: usize
§bytes_sent: usize
§bytes_received: usize
§egress_packets_per_sec: usize
§egress_bytes_per_sec: usize
§ingress_packets_per_sec: usize
§ingress_bytes_per_sec: usize
§first_seen: SystemTime
§last_seen: SystemTime
Implementations§
source§impl TrafficInfo
impl TrafficInfo
pub fn new() -> Self
pub fn add_traffic(&mut self, traffic: &TrafficInfo)
pub fn update_egress_packets_per_sec( &mut self, sent_packets: usize, duration: Duration, )
pub fn update_egress_bytes_per_sec( &mut self, sent_bytes: usize, duration: Duration, )
pub fn update_ingress_packets_per_sec( &mut self, received_packets: usize, duration: Duration, )
pub fn update_ingress_bytes_per_sec( &mut self, received_bytes: usize, duration: Duration, )
pub fn update_bytes_per_sec( &mut self, traffic: &TrafficInfo, duration: Duration, )
pub fn total_packet(&self) -> usize
pub fn total_bytes(&self) -> usize
pub fn format_bytes(bytes: usize) -> String
pub fn format_packets(packets: usize) -> String
pub fn formatted_total_bytes(&self) -> String
pub fn formatted_total_packets(&self) -> String
pub fn formatted_packet_sent(&self) -> String
pub fn formatted_packet_received(&self) -> String
pub fn formatted_sent_bytes(&self) -> String
pub fn formatted_received_bytes(&self) -> String
pub fn formatted_egress_packets_per_sec(&self) -> String
pub fn formatted_ingress_packets_per_sec(&self) -> String
pub fn formatted_egress_bytes_per_sec(&self) -> String
pub fn formatted_ingress_bytes_per_sec(&self) -> String
pub fn to_display_info(&self) -> TrafficDisplayInfo
Trait Implementations§
source§impl Clone for TrafficInfo
impl Clone for TrafficInfo
source§fn clone(&self) -> TrafficInfo
fn clone(&self) -> TrafficInfo
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for TrafficInfo
impl Debug for TrafficInfo
source§impl<'de> Deserialize<'de> for TrafficInfo
impl<'de> Deserialize<'de> for TrafficInfo
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for TrafficInfo
impl RefUnwindSafe for TrafficInfo
impl Send for TrafficInfo
impl Sync for TrafficInfo
impl Unpin for TrafficInfo
impl UnwindSafe for TrafficInfo
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