Pinger

Struct Pinger 

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

Main pinger that coordinates different ping implementations

Implementations§

Source§

impl Pinger

Source

pub fn new(config: PingConfig, mode: PingMode) -> PingResult<Self>

Create a new pinger with the specified configuration and mode

Source

pub fn new_tcp_with_port(config: PingConfig, port: u16) -> PingResult<Self>

Create a new TCP pinger with a specific port

Source

pub fn new_udp_with_port(config: PingConfig, port: u16) -> PingResult<Self>

Create a new UDP pinger with a specific port

Source

pub fn ping_once(&self) -> PingResult<PingReply>

Send a single ping and return the result

Source

pub fn ping_sequence(&self, sequence: u16) -> PingResult<PingReply>

Send a ping with a specific sequence number

Source

pub fn ping_all(&self) -> PingResult<PingStatistics>

Send multiple pings according to the configuration

Source

pub fn ping_with_callback<F>(&self, callback: F) -> PingResult<PingStatistics>

Send pings with a custom callback for each result

Source

pub fn mode(&self) -> PingMode

Get the ping mode

Source

pub fn config(&self) -> &PingConfig

Get the configuration

Source

pub fn is_initialized(&self) -> bool

Check if the pinger is properly initialized

Source

pub fn info(&self) -> String

Get information about the pinger setup

Auto Trait Implementations§

§

impl Freeze for Pinger

§

impl RefUnwindSafe for Pinger

§

impl Send for Pinger

§

impl Sync for Pinger

§

impl Unpin for Pinger

§

impl UnwindSafe for Pinger

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V