[][src]Struct winping::Pinger

pub struct Pinger { /* fields omitted */ }

A pinger that blocks when sending.

Implementations

impl Pinger[src]

pub fn new() -> Result<Self, CreateError>[src]

Creates a new Pinger. If one ICMP handle (v4 or v6) fails to initialize, this will return the Pinger embedded in an error. The Pinger is still usable in this state, but sending on the failed version will return an Error. If both v4 and v6 fail, the pinger is not embedded in the error.

pub fn new_v4() -> Option<Self>[src]

Creates a new Pinger, ignoring v6 failures. If you want to use both v4 and v6, use new() instead.

pub fn new_v6() -> Option<Self>[src]

Creates a new Pinger, ignoring v4 failures. If you want to use both v4 and v6, use new() instead.

pub fn set_ttl(&mut self, ttl: u8)[src]

Sets the IP TTL for future requets.

pub fn ttl(&self) -> u8[src]

Gets the current IP TTL value.

pub fn set_df(&mut self, df: bool)[src]

Sets the IP Don't Fragment bit for future requests.

pub fn df(&self) -> bool[src]

Gets the current IP Don't Fragment bit.

pub fn set_timeout(&mut self, timeout: u32)[src]

Sets the timeout, in milliseconds, for future requests.

pub fn timeout(&self) -> u32[src]

Gets the current timeout in milliseconds.

pub fn send4(&self, dst: Ipv4Addr, buf: &mut Buffer) -> Result<u32, Error>[src]

Send an ICMPv4 request to the destination address. On success, returns the round trip time in milliseconds.

pub fn send4_from(
    &self,
    src: Ipv4Addr,
    dst: Ipv4Addr,
    buf: &mut Buffer
) -> Result<u32, Error>
[src]

Sends an ICMPv4 request from the source address to the destination address. On success, returns the round trip time in milliseconds.

pub fn send6(&self, dst: Ipv6Addr, buf: &mut Buffer) -> Result<u32, Error>[src]

Sends an ICMPv6 request to the destination address. On success, returns the round trip time in milliseconds.

pub fn send6_from(
    &self,
    src: Ipv6Addr,
    dst: Ipv6Addr,
    buf: &mut Buffer
) -> Result<u32, Error>
[src]

Sends an ICMPv6 request from the source address to the destination address. On success, returns the round trip time in milliseconds.

pub fn send(&self, dst: IpAddr, buf: &mut Buffer) -> Result<u32, Error>[src]

Sends an ICMP request to the destination address. Supports both v4 and v6. On success, returns the round trip time in milliseconds.

pub fn send_from(
    &mut self,
    src_dst_pair: IpPair,
    buf: &mut Buffer
) -> Result<u32, Error>
[src]

Sends an ICMP request from the source address to the destination address. Supports both v4 and v6. On success, returns the round trip time in milliseconds.

Trait Implementations

impl Clone for Pinger[src]

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

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.