pub struct Pinger { /* private fields */ }Expand description
Main pinger that coordinates different ping implementations
Implementations§
Source§impl Pinger
impl Pinger
Sourcepub fn new(config: PingConfig, mode: PingMode) -> PingResult<Self>
pub fn new(config: PingConfig, mode: PingMode) -> PingResult<Self>
Create a new pinger with the specified configuration and mode
Sourcepub fn new_tcp_with_port(config: PingConfig, port: u16) -> PingResult<Self>
pub fn new_tcp_with_port(config: PingConfig, port: u16) -> PingResult<Self>
Create a new TCP pinger with a specific port
Sourcepub fn new_udp_with_port(config: PingConfig, port: u16) -> PingResult<Self>
pub fn new_udp_with_port(config: PingConfig, port: u16) -> PingResult<Self>
Create a new UDP pinger with a specific port
Sourcepub fn ping_once(&self) -> PingResult<PingReply>
pub fn ping_once(&self) -> PingResult<PingReply>
Send a single ping and return the result
Sourcepub fn ping_sequence(&self, sequence: u16) -> PingResult<PingReply>
pub fn ping_sequence(&self, sequence: u16) -> PingResult<PingReply>
Send a ping with a specific sequence number
Sourcepub fn ping_all(&self) -> PingResult<PingStatistics>
pub fn ping_all(&self) -> PingResult<PingStatistics>
Send multiple pings according to the configuration
Sourcepub fn ping_with_callback<F>(&self, callback: F) -> PingResult<PingStatistics>
pub fn ping_with_callback<F>(&self, callback: F) -> PingResult<PingStatistics>
Send pings with a custom callback for each result
Sourcepub fn config(&self) -> &PingConfig
pub fn config(&self) -> &PingConfig
Get the configuration
Sourcepub fn is_initialized(&self) -> bool
pub fn is_initialized(&self) -> bool
Check if the pinger is properly initialized
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> 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