Struct surge_ping::Pinger
source · pub struct Pinger {
pub host: IpAddr,
pub ident: PingIdentifier,
/* private fields */
}Expand description
A Ping struct represents the state of one particular ping instance.
Fields
host: IpAddrident: PingIdentifierImplementations
sourceimpl 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.
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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more