pub struct IcmpSocket { /* private fields */ }Implementations§
Source§impl IcmpSocket
impl IcmpSocket
pub async fn with<F, R>(&self, f: F) -> R
pub async fn with_mutable<F, R>(&self, f: F) -> R
pub fn poll_with<F, R>(&self, context: &mut Context<'_>, f: F) -> Poll<R>
pub fn poll_with_mutable<F, R>( &self, context: &mut Context<'_>, f: F, ) -> Poll<R>
pub async fn bind(&self, endpoint: IcmpEndpoint) -> Result<()>
pub async fn can_write(&self) -> bool
pub async fn can_read(&self) -> bool
pub async fn write_to( &self, buffer: &[u8], endpoint: impl Into<IpAddress>, ) -> Result<()>
pub async fn read_from(&self, buffer: &mut [u8]) -> Result<(usize, IpAddress)>
pub async fn read_from_with_timeout( &self, buffer: &mut [u8], timeout: impl Into<Duration>, ) -> Result<(usize, IpAddress)>
Sourcepub async fn ping(
&self,
remote_address: &IpAddress,
sequence_number: u16,
identifier: u16,
timeout: Duration,
payload_size: usize,
) -> Result<Duration>
pub async fn ping( &self, remote_address: &IpAddress, sequence_number: u16, identifier: u16, timeout: Duration, payload_size: usize, ) -> Result<Duration>
Sends an ICMP echo request (ping) to the specified remote address and waits for a reply. Returns the round-trip time if successful.
§Errors
Returns an error if the ping request fails or times out.
pub async fn flush(&self)
pub async fn is_open(&self) -> bool
pub async fn get_packet_read_capacity(&self) -> usize
pub async fn get_packet_write_capacity(&self) -> usize
pub async fn get_payload_read_capacity(&self) -> usize
pub async fn get_payload_write_capacity(&self) -> usize
pub async fn get_hop_limit(&self) -> Option<u8>
pub async fn set_hop_limit(&self, hop_limit: Option<u8>)
Auto Trait Implementations§
impl Freeze for IcmpSocket
impl !RefUnwindSafe for IcmpSocket
impl Send for IcmpSocket
impl Sync for IcmpSocket
impl Unpin for IcmpSocket
impl !UnwindSafe for IcmpSocket
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