Stats

Struct Stats 

Source
pub struct Stats { /* private fields */ }
Expand description

Mutable accumulator used during a session.

Implementations§

Source§

impl Stats

Source

pub fn new(addr: SocketAddr, resolve_ms: f64) -> Self

Create a new accumulator.

Source

pub fn feed(&mut self, success: bool, rtt: f64, want_jitter: bool) -> PingResult

Feed one probe result and obtain a PingResult to hand to the formatter.

Source

pub fn should_continue(&self, args: &Args) -> bool

Should the main loop continue?

Source

pub fn should_break(&self, success: bool, args: &Args) -> bool

Should we break early because -e/–exit-on-success?

Source

pub fn summary(&self) -> Summary

Produce the final Summary.

Source

pub fn exit_code(&self) -> i32

Map statistics to a conventional Unix exit code.

Auto Trait Implementations§

§

impl Freeze for Stats

§

impl RefUnwindSafe for Stats

§

impl Send for Stats

§

impl Sync for Stats

§

impl Unpin for Stats

§

impl UnwindSafe for Stats

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.