pub struct LocalTcpStream { /* private fields */ }
Trait Implementations
sourceimpl Debug for LocalTcpStream
impl Debug for LocalTcpStream
sourceimpl VirtualConnectedSocket for LocalTcpStream
impl VirtualConnectedSocket for LocalTcpStream
sourcefn 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) Read more
sourcefn 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 Read more
sourcefn 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
sourcefn recv(&mut self) -> Result<SocketReceive>
fn recv(&mut self) -> Result<SocketReceive>
Recv a packet from the socket
sourcefn peek(&mut self) -> Result<SocketReceive>
fn peek(&mut self) -> Result<SocketReceive>
Peeks for a packet from the socket
sourceimpl VirtualSocket for LocalTcpStream
impl VirtualSocket for LocalTcpStream
sourcefn 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
sourcefn ttl(&self) -> Result<u32>
fn ttl(&self) -> Result<u32>
Returns the maximum number of network hops before packets are dropped
sourcefn addr_local(&self) -> Result<SocketAddr>
fn addr_local(&self) -> Result<SocketAddr>
Returns the local address for this socket
sourcefn status(&self) -> Result<SocketStatus>
fn status(&self) -> Result<SocketStatus>
Returns the status/state of the socket
sourceimpl VirtualTcpSocket for LocalTcpStream
impl VirtualTcpSocket for LocalTcpStream
sourcefn 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
sourcefn opt_time(&self, ty: TimeType) -> Result<Option<Duration>>
fn opt_time(&self, ty: TimeType) -> Result<Option<Duration>>
Returns one of the previous set timeouts
sourcefn 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 Read more
sourcefn 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 Read more
sourcefn 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 Read more
sourcefn 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. Read more
sourcefn 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. Read more
sourcefn 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. Read more
sourcefn 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 Read more
Auto Trait Implementations
impl RefUnwindSafe for LocalTcpStream
impl Send for LocalTcpStream
impl Sync for LocalTcpStream
impl Unpin for LocalTcpStream
impl UnwindSafe for LocalTcpStream
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more