pub struct PingRequest { /* private fields */ }Expand description
A single ICMP echo request.
Implementations§
Source§impl PingRequest
impl PingRequest
Sourcepub fn new(sequence: u16) -> Self
pub fn new(sequence: u16) -> Self
Creates a request with a sequence number and the pinger’s default payload.
Sourcepub fn payload(self, payload: impl Into<Vec<u8>>) -> Self
pub fn payload(self, payload: impl Into<Vec<u8>>) -> Self
Uses exact bytes as the ICMP echo payload for this request.
Sourcepub fn payload_bytes(&self) -> Option<&[u8]>
pub fn payload_bytes(&self) -> Option<&[u8]>
Returns the custom payload bytes, if this request has one.
Trait Implementations§
Source§impl Clone for PingRequest
impl Clone for PingRequest
Source§fn clone(&self) -> PingRequest
fn clone(&self) -> PingRequest
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PingRequest
impl Debug for PingRequest
Source§impl From<u16> for PingRequest
impl From<u16> for PingRequest
Source§impl PartialEq for PingRequest
impl PartialEq for PingRequest
Source§fn eq(&self, other: &PingRequest) -> bool
fn eq(&self, other: &PingRequest) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for PingRequest
impl StructuralPartialEq for PingRequest
Auto Trait Implementations§
impl Freeze for PingRequest
impl RefUnwindSafe for PingRequest
impl Send for PingRequest
impl Sync for PingRequest
impl Unpin for PingRequest
impl UnsafeUnpin for PingRequest
impl UnwindSafe for PingRequest
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