Struct surge_ping::Pinger
source · pub struct Pinger {
pub host: IpAddr,
pub ident: Option<PingIdentifier>,
/* private fields */
}
Expand description
A Ping struct represents the state of one particular ping instance.
Fields§
§host: IpAddr
§ident: Option<PingIdentifier>
Implementations§
source§impl Pinger
impl Pinger
sourcepub fn timeout(&mut self, timeout: Duration) -> &mut Pinger
pub fn timeout(&mut self, timeout: Duration) -> &mut Pinger
The timeout of each Ping, in seconds. (default: 2s)
sourcepub async fn ping(
&mut self,
seq: PingSequence,
payload: &[u8]
) -> Result<(IcmpPacket, Duration), SurgeError>
pub async fn ping( &mut self, seq: PingSequence, payload: &[u8] ) -> Result<(IcmpPacket, Duration), SurgeError>
Send Ping request with sequence number.
sourcepub async fn send_ping(
&self,
seq: PingSequence,
payload: &[u8]
) -> Result<(), SurgeError>
pub async fn send_ping( &self, seq: PingSequence, payload: &[u8] ) -> Result<(), SurgeError>
Send a ping packet (useful, when you don’t need a reply).
Trait Implementations§
Auto Trait Implementations§
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