pub struct ListenerSocket { /* private fields */ }
Expand description
Receive all IPv4 or IPv6 packets passing through a network interface.
Implementations§
Source§impl ListenerSocket
impl ListenerSocket
Sourcepub fn new(
_socket_addr: SocketAddr,
ip_version: IpVersion,
protocol: Option<IpNextLevelProtocol>,
timeout: Option<Duration>,
) -> Result<ListenerSocket>
pub fn new( _socket_addr: SocketAddr, ip_version: IpVersion, protocol: Option<IpNextLevelProtocol>, timeout: Option<Duration>, ) -> Result<ListenerSocket>
Constructs a new ListenerSocket.
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 ListenerSocket
impl RefUnwindSafe for ListenerSocket
impl Send for ListenerSocket
impl Sync for ListenerSocket
impl Unpin for ListenerSocket
impl UnwindSafe for ListenerSocket
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