pub trait IcmpSocket<I>: Unpinwhere
I: IpExt,{
// Required methods
fn async_recv_from(
&self,
buf: &mut [u8],
cx: &mut Context<'_>,
) -> Poll<Result<(usize, I::SockAddr)>>;
fn async_send_to_vectored(
&self,
bufs: &[IoSlice<'_>],
addr: &I::SockAddr,
cx: &mut Context<'_>,
) -> Poll<Result<usize>>;
fn bind_device(&self, interface: Option<&[u8]>) -> Result<()>;
}Expand description
Async ICMP socket.
Required Methods§
Sourcefn async_recv_from(
&self,
buf: &mut [u8],
cx: &mut Context<'_>,
) -> Poll<Result<(usize, I::SockAddr)>>
fn async_recv_from( &self, buf: &mut [u8], cx: &mut Context<'_>, ) -> Poll<Result<(usize, I::SockAddr)>>
Async method for receiving an ICMP packet.
Upon successful return, buf will contain an ICMP packet.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl<I> IcmpSocket<I> for DatagramSocketwhere
I: IpExt,
impl<I> IcmpSocket<I> for DatagramSocketwhere
I: IpExt,
Source§fn async_recv_from(
&self,
buf: &mut [u8],
cx: &mut Context<'_>,
) -> Poll<Result<(usize, I::SockAddr)>>
fn async_recv_from( &self, buf: &mut [u8], cx: &mut Context<'_>, ) -> Poll<Result<(usize, I::SockAddr)>>
Async method for receiving an ICMP packet.
Source§fn async_send_to_vectored(
&self,
bufs: &[IoSlice<'_>],
addr: &I::SockAddr,
cx: &mut Context<'_>,
) -> Poll<Result<usize>>
fn async_send_to_vectored( &self, bufs: &[IoSlice<'_>], addr: &I::SockAddr, cx: &mut Context<'_>, ) -> Poll<Result<usize>>
Async method for sending an ICMP packet.