pub struct AsyncIcmpSocket { /* private fields */ }Expand description
Asynchronous ICMP socket built on Tokio.
Implementations§
Source§impl AsyncIcmpSocket
impl AsyncIcmpSocket
Sourcepub async fn new(config: &IcmpConfig) -> Result<Self>
pub async fn new(config: &IcmpConfig) -> Result<Self>
Create a new asynchronous ICMP socket.
Sourcepub async fn send_to(&self, buf: &[u8], target: SocketAddr) -> Result<usize>
pub async fn send_to(&self, buf: &[u8], target: SocketAddr) -> Result<usize>
Send a packet asynchronously.
Sourcepub async fn recv_from(&self, buf: &mut [u8]) -> Result<(usize, SocketAddr)>
pub async fn recv_from(&self, buf: &mut [u8]) -> Result<(usize, SocketAddr)>
Receive a packet asynchronously.
Sourcepub fn local_addr(&self) -> Result<SocketAddr>
pub fn local_addr(&self) -> Result<SocketAddr>
Retrieve the local address.
Sourcepub fn socket_type(&self) -> IcmpSocketType
pub fn socket_type(&self) -> IcmpSocketType
Return the socket type (DGRAM or RAW).
Sourcepub fn socket_family(&self) -> SocketFamily
pub fn socket_family(&self) -> SocketFamily
Return the socket family.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for AsyncIcmpSocket
impl RefUnwindSafe for AsyncIcmpSocket
impl Send for AsyncIcmpSocket
impl Sync for AsyncIcmpSocket
impl Unpin for AsyncIcmpSocket
impl UnwindSafe for AsyncIcmpSocket
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