Skip to main content

StreamOps

Trait StreamOps 

Source
pub trait StreamOps {
    // Provided methods
    fn set_tcp_notsent_lowat(&self, _notsent_lowat: u32) -> IoResult<()> { ... }
    fn new_handle(&self) -> Box<dyn StreamOps + Send + Unpin> { ... }
}
Expand description

Additional operations that can be performed on connected stream sockets.

Some operations provided by this trait set socket options (setsockopt()). Some socket options cannot be set after a stream socket is connected, so these options are not provided by this trait. Instead, they should be set through options given to NetStreamProvider::connect() or NetStreamProvider::listen(). For example, see the options provided by TcpListenOptions.

Provided Methods§

Source

fn set_tcp_notsent_lowat(&self, _notsent_lowat: u32) -> IoResult<()>

Set the TCP_NOTSENT_LOWAT socket option, if this Stream is a TCP stream.

Implementations should return an UnsupportedStreamOp IO error if the stream is not a TCP stream, and on platforms where the operation is not supported.

Source

fn new_handle(&self) -> Box<dyn StreamOps + Send + Unpin>

Return a new handle that implements StreamOps, and that can be used independently of self.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl StreamOps for TcpStream

Source§

fn set_tcp_notsent_lowat(&self, notsent_lowat: u32) -> IoResult<()>

Source§

fn new_handle(&self) -> Box<dyn StreamOps + Send + Unpin>

Source§

impl StreamOps for TcpStream

Source§

impl StreamOps for UnixStream

Available on Unix only.
Source§

fn set_tcp_notsent_lowat(&self, _notsent_lowat: u32) -> IoResult<()>

Source§

impl StreamOps for UnixStream

Available on Unix only.
Source§

fn set_tcp_notsent_lowat(&self, _notsent_lowat: u32) -> IoResult<()>

Source§

impl<S: AsyncRead + AsyncWrite + StreamOps + Unpin> StreamOps for TlsStream<S>

Source§

fn set_tcp_notsent_lowat(&self, notsent_lowat: u32) -> IoResult<()>

Source§

fn new_handle(&self) -> Box<dyn StreamOps + Send + Unpin>

Source§

impl<S: StreamOps> StreamOps for TlsStream<S>

Source§

fn set_tcp_notsent_lowat(&self, notsent_lowat: u32) -> IoResult<()>

Source§

fn new_handle(&self) -> Box<dyn StreamOps + Send + Unpin>

Source§

impl<T: StreamOps, C> StreamOps for Framed<T, C>

Source§

fn set_tcp_notsent_lowat(&self, notsent_lowat: u32) -> IoResult<()>

Source§

fn new_handle(&self) -> Box<dyn StreamOps + Send + Unpin>

Implementors§

Source§

impl StreamOps for FakeStream

Source§

impl StreamOps for NoOpStreamOpsHandle

Source§

impl StreamOps for Stream

Source§

impl StreamOps for TcpSockFd

Available on Linux only.
Source§

impl StreamOps for tor_rtcompat::impls::tokio::net::TcpStream

Source§

impl StreamOps for UnimplementedTls

Source§

impl StreamOps for tor_rtcompat::impls::tokio::net::UnixStream

Available on Unix only.
Source§

impl<S: StreamOps> StreamOps for RustlsServerStream<S>