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 scope_id(&mut self, scope_id: u32) -> &mut Pinger
pub fn scope_id(&mut self, scope_id: u32) -> &mut Pinger
The scope id of the IPv6 socket address.
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 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