pub struct LocalTcpStream { /* private fields */ }
Trait Implementations§
source§impl Debug for LocalTcpStream
impl Debug for LocalTcpStream
source§impl VirtualConnectedSocket for LocalTcpStream
impl VirtualConnectedSocket for LocalTcpStream
source§fn set_linger(&mut self, linger: Option<Duration>) -> Result<()>
fn set_linger(&mut self, linger: Option<Duration>) -> Result<()>
Determines how long the socket will remain in a TIME_WAIT
after it disconnects (only the one that initiates the close will
be in a TIME_WAIT state thus the clients should always do this rather
than the server)
source§fn linger(&self) -> Result<Option<Duration>>
fn linger(&self) -> Result<Option<Duration>>
Returns how long the socket will remain in a TIME_WAIT
after it disconnects
source§fn send(&mut self, data: Bytes) -> Result<usize>
fn send(&mut self, data: Bytes) -> Result<usize>
Sends out a datagram or stream of bytes on this socket
source§fn recv(&mut self) -> Result<SocketReceive>
fn recv(&mut self) -> Result<SocketReceive>
Recv a packet from the socket
source§fn peek(&mut self) -> Result<SocketReceive>
fn peek(&mut self) -> Result<SocketReceive>
Peeks for a packet from the socket
source§impl VirtualSocket for LocalTcpStream
impl VirtualSocket for LocalTcpStream
source§fn set_ttl(&mut self, ttl: u32) -> Result<()>
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>
fn ttl(&self) -> Result<u32>
Returns the maximum number of network hops before packets are dropped
source§fn addr_local(&self) -> Result<SocketAddr>
fn addr_local(&self) -> Result<SocketAddr>
Returns the local address for this socket
source§fn status(&self) -> Result<SocketStatus>
fn status(&self) -> Result<SocketStatus>
Returns the status/state of the socket
source§impl VirtualTcpSocket for LocalTcpStream
impl VirtualTcpSocket for LocalTcpStream
source§fn set_opt_time(&mut self, ty: TimeType, timeout: Option<Duration>) -> Result<()>
fn set_opt_time(&mut self, ty: TimeType, timeout: Option<Duration>) -> Result<()>
Sets the timeout for a specific action on the socket
source§fn opt_time(&self, ty: TimeType) -> Result<Option<Duration>>
fn opt_time(&self, ty: TimeType) -> Result<Option<Duration>>
Returns one of the previous set timeouts
source§fn set_recv_buf_size(&mut self, size: usize) -> Result<()>
fn set_recv_buf_size(&mut self, size: usize) -> Result<()>
Sets the receive buffer size which acts as a trottle for how
much data is buffered on this side of the pipe
source§fn recv_buf_size(&self) -> Result<usize>
fn recv_buf_size(&self) -> Result<usize>
Size of the receive buffer that holds all data that has not
yet been read
source§fn set_send_buf_size(&mut self, size: usize) -> Result<()>
fn set_send_buf_size(&mut self, size: usize) -> Result<()>
Sets the size of the send buffer which will hold the bytes of
data while they are being sent over to the peer
source§fn send_buf_size(&self) -> Result<usize>
fn send_buf_size(&self) -> Result<usize>
Size of the send buffer that holds all data that is currently
being transmitted.
source§fn set_nodelay(&mut self, nodelay: bool) -> Result<()>
fn set_nodelay(&mut self, nodelay: bool) -> Result<()>
When NO_DELAY is set the data that needs to be transmitted to
the peer is sent immediately rather than waiting for a bigger
batch of data, this reduces latency but increases encapsulation
overhead.
source§fn nodelay(&self) -> Result<bool>
fn nodelay(&self) -> Result<bool>
Indicates if the NO_DELAY flag is set which means that data
is immediately sent to the peer without waiting. This reduces
latency but increases encapsulation overhead.
source§fn addr_peer(&self) -> Result<SocketAddr>
fn addr_peer(&self) -> Result<SocketAddr>
Returns the address (IP and Port) of the peer socket that this
is conencted to