Struct surge_ping::Pinger
source · [−]pub struct Pinger {
pub destination: IpAddr,
pub ident: u16,
pub size: usize,
/* private fields */
}
Expand description
A Ping struct represents the state of one particular ping instance.
Fields
destination: IpAddr
ident: u16
size: usize
Implementations
sourceimpl Pinger
impl Pinger
sourcepub fn size(&mut self, size: usize) -> &mut Pinger
pub fn size(&mut self, size: usize) -> &mut Pinger
Set the packet payload size, minimal is 16. (default: 56)
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_cnt: u16
) -> Result<(IcmpPacket, Duration), SurgeError>
pub async fn ping(
&mut self,
seq_cnt: u16
) -> Result<(IcmpPacket, Duration), SurgeError>
Send Ping request with sequence number.
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 T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
pub fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more