Struct nex_socket::PacketReceiver
source · pub struct PacketReceiver { /* private fields */ }
Expand description
Receive all IPv4 or IPv6 packets passing through a network interface.
Implementations§
source§impl PacketReceiver
impl PacketReceiver
sourcepub fn new(
_socket_addr: SocketAddr,
ip_version: IpVersion,
protocol: Option<IpNextLevelProtocol>,
timeout: Option<Duration>
) -> Result<PacketReceiver>
pub fn new( _socket_addr: SocketAddr, ip_version: IpVersion, protocol: Option<IpNextLevelProtocol>, timeout: Option<Duration> ) -> Result<PacketReceiver>
Constructs a new PacketReceiver.
sourcepub fn receive_from(&self, buf: &mut Vec<u8>) -> Result<(usize, SocketAddr)>
pub fn receive_from(&self, buf: &mut Vec<u8>) -> Result<(usize, SocketAddr)>
Receive packet without source address.
Auto Trait Implementations§
impl Freeze for PacketReceiver
impl RefUnwindSafe for PacketReceiver
impl Send for PacketReceiver
impl Sync for PacketReceiver
impl Unpin for PacketReceiver
impl UnwindSafe for PacketReceiver
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