[][src]Struct surge_ping::Pinger

pub struct Pinger { /* fields omitted */ }

Examples

use std::time::Duration;

use surge_ping::Pinger;

#[tokio::main]
async fn main() {
    let mut pinger = Pinger::new("114.114.114.114".parse().unwrap()).unwrap();
    pinger.size(56).timeout(Duration::from_secs(1));
    let result = pinger.ping(0).await;
    println!("{:?}", result);
}

Implementations

impl Pinger[src]

pub fn new(host: IpAddr) -> Result<Pinger, SurgeError>[src]

pub fn ident(&mut self, val: u16) -> &mut Self[src]

pub fn size(&mut self, size: usize) -> &mut Self[src]

pub fn timeout(&mut self, timeout: Duration) -> &mut Self[src]

pub async fn ping(
    &self,
    seq_cnt: u16
) -> Result<(EchoReply, Duration), SurgeError>
[src]

Trait Implementations

impl Clone for Pinger[src]

impl Debug for Pinger[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,