pub struct AsyncPacketSocket { /* private fields */ }Expand description
An asynchronous socket wrapper for sending and receiving network packets.
This struct provides an async interface for working with raw sockets using the Tokio runtime.
Implementations§
Source§impl AsyncPacketSocket
impl AsyncPacketSocket
Sourcepub async fn new(protocol: Protocol) -> Result<Self>
pub async fn new(protocol: Protocol) -> Result<Self>
Creates a new async raw socket for the specified protocol.
§Arguments
protocol- The protocol to use (e.g., TCP, UDP)
Sourcepub async fn send<P: PacketBuilder>(
&self,
packet: &P,
dst_addr: Ipv4Addr,
) -> Result<usize, PacketError>
pub async fn send<P: PacketBuilder>( &self, packet: &P, dst_addr: Ipv4Addr, ) -> Result<usize, PacketError>
Auto Trait Implementations§
impl !Freeze for AsyncPacketSocket
impl RefUnwindSafe for AsyncPacketSocket
impl Send for AsyncPacketSocket
impl Sync for AsyncPacketSocket
impl Unpin for AsyncPacketSocket
impl UnsafeUnpin for AsyncPacketSocket
impl UnwindSafe for AsyncPacketSocket
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