Struct libdata::stats::Sizes
[−]
pub struct Sizes { pub dir_in: Size, pub dir_out: Size, }
A poorer version of Stats
This one contains only the number of packets and the size. It is used during the construction of the flow slice and the other statistics are added later on.
Because the duration and the fact it relates to a single flow is known during the conversion, the other statistics are not needed and this makes it easier to manipulate.
Fields
dir_in: Size
The inbound direction.
dir_out: Size
The outbound direction.
Methods
impl Sizes
fn expand(
&self,
start: SystemTime,
end: SystemTime,
speed_duration: Duration,
started: bool
) -> Stats
&self,
start: SystemTime,
end: SystemTime,
speed_duration: Duration,
started: bool
) -> Stats
Expands into full Stats
Params
start
: The absolute time when the flow slice starts. This is either start of the slice, or start of the flow if it starts inside the slice.end
: The opposite ofstart
.speed_duration
: The duration of the flow slice used for speed computation. Due to some issues with summing maximal and average speeds, this is not always the same asend - start
.started
: Did the flow start in this slice?
fn sub_safe(&self, other: &Sizes) -> bool
Checks if other is equal or smaller in each subfield.
This basically checks if it is safe to do self - other
.
Trait Implementations
impl Add for Sizes
type Output = Sizes
The resulting type after applying the +
operator
fn add(self, rhs: Sizes) -> Sizes
The method for the +
operator
impl AddAssign for Sizes
fn add_assign(&mut self, rhs: Sizes)
The method for the +=
operator
impl Clone for Sizes
fn clone(&self) -> Sizes
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Debug for Sizes
impl Default for Sizes
impl Eq for Sizes
impl PartialEq for Sizes
fn eq(&self, __arg_0: &Sizes) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Sizes) -> bool
This method tests for !=
.