pub trait VirtualSocket: Debug + Send + Sync + 'static {
    // Required methods
    fn set_ttl(&mut self, ttl: u32) -> Result<()>;
    fn ttl(&self) -> Result<u32>;
    fn addr_local(&self) -> Result<SocketAddr>;
    fn status(&self) -> Result<SocketStatus>;
    fn poll_read_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<usize>>;
    fn poll_write_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<usize>>;
}

Required Methods§

source

fn set_ttl(&mut self, ttl: u32) -> Result<()>

Sets how many network hops the packets are permitted for new connections

source

fn ttl(&self) -> Result<u32>

Returns the maximum number of network hops before packets are dropped

source

fn addr_local(&self) -> Result<SocketAddr>

Returns the local address for this socket

source

fn status(&self) -> Result<SocketStatus>

Returns the status/state of the socket

source

fn poll_read_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<usize>>

Polls the socket for when there is data to be received

source

fn poll_write_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<usize>>

Polls the socket for when the backpressure allows for writing to the socket

Implementors§