[][src]Struct winping::Buffer

pub struct Buffer {
    pub request_data: Vec<u8>,
    // some fields omitted
}

A buffer for request and reply data.

Fields

request_data: Vec<u8>

Implementations

impl Buffer[src]

pub const fn new() -> Self[src]

Creates a new, empty buffer with no request data.

pub const fn with_data(request_data: Vec<u8>) -> Self[src]

Creates a new buffer with the provided request data.

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

Gets the reply data from the last ping this buffer was used in. The reply data may be empty if a reuqest was not send with this buffer, or if there was no reply to the sent request.

pub fn responding_ipv4(&self) -> Option<Ipv4Addr>[src]

Gets the responding Ipv6Addr from the last request this buffer was involved in. Returns None if the last request was v6, the buffer wasn't used in a request, or there was no reply.

pub fn responding_ipv6(&self) -> Option<Ipv6Addr>[src]

Gets the responding Ipv6Addr from the last request this buffer was involved in. Returns None if the last request was v4, the buffer wasn't used in a request, or there was no reply.

pub fn responding_ip(&self) -> Option<IpAddr>[src]

Gets the responding IpAddr from the last request this buffer was involved in. Returns None if the buffer wasn't used in a request, or there was no reply.

Trait Implementations

impl Clone for Buffer[src]

impl Debug for Buffer[src]

impl Default for Buffer[src]

Auto Trait Implementations

impl RefUnwindSafe for Buffer

impl Send for Buffer

impl Sync for Buffer

impl Unpin for Buffer

impl UnwindSafe for Buffer

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.