Trait virtual_net::VirtualTcpListener
source · pub trait VirtualTcpListener: Debug + Send + Sync + 'static {
// Required methods
fn try_accept(
&mut self
) -> Option<Result<(Box<dyn VirtualTcpSocket + Sync>, SocketAddr)>>;
fn poll_accept(
&mut self,
cx: &mut Context<'_>
) -> Poll<Result<(Box<dyn VirtualTcpSocket + Sync>, SocketAddr)>>;
fn poll_accept_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<usize>>;
fn addr_local(&self) -> Result<SocketAddr>;
fn set_ttl(&mut self, ttl: u8) -> Result<()>;
fn ttl(&self) -> Result<u8>;
}
Required Methods§
sourcefn try_accept(
&mut self
) -> Option<Result<(Box<dyn VirtualTcpSocket + Sync>, SocketAddr)>>
fn try_accept( &mut self ) -> Option<Result<(Box<dyn VirtualTcpSocket + Sync>, SocketAddr)>>
Tries to accept a new connection
sourcefn poll_accept(
&mut self,
cx: &mut Context<'_>
) -> Poll<Result<(Box<dyn VirtualTcpSocket + Sync>, SocketAddr)>>
fn poll_accept( &mut self, cx: &mut Context<'_> ) -> Poll<Result<(Box<dyn VirtualTcpSocket + Sync>, SocketAddr)>>
Polls the socket for new connections
sourcefn poll_accept_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<usize>>
fn poll_accept_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<usize>>
Polls the socket for when there is data to be received
sourcefn addr_local(&self) -> Result<SocketAddr>
fn addr_local(&self) -> Result<SocketAddr>
Returns the local address of this TCP listener