pub enum EitherStream {
Plain(TcpStream),
Tls(TlsStream<TcpStream>),
}
Available on crate feature
ws
only.Expand description
Stream to represent either a unencrypted or encrypted socket stream.
Variants§
Trait Implementations§
source§impl AsyncRead for EitherStream
impl AsyncRead for EitherStream
source§impl AsyncWrite for EitherStream
impl AsyncWrite for EitherStream
source§fn poll_write(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
buf: &[u8],
) -> Poll<Result<usize, IoError>>
fn poll_write( self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &[u8], ) -> Poll<Result<usize, IoError>>
Attempt to write bytes from
buf
into the object. Read moresource§fn poll_flush(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
) -> Poll<Result<(), IoError>>
fn poll_flush( self: Pin<&mut Self>, cx: &mut Context<'_>, ) -> Poll<Result<(), IoError>>
Attempts to flush the object, ensuring that any buffered data reach
their destination. Read more
source§fn poll_shutdown(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
) -> Poll<Result<(), IoError>>
fn poll_shutdown( self: Pin<&mut Self>, cx: &mut Context<'_>, ) -> Poll<Result<(), IoError>>
Initiates or attempts to shut down this writer, returning success when
the I/O connection has completely shut down. Read more
source§fn poll_write_vectored(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
bufs: &[IoSlice<'_>],
) -> Poll<Result<usize, Error>>
fn poll_write_vectored( self: Pin<&mut Self>, cx: &mut Context<'_>, bufs: &[IoSlice<'_>], ) -> Poll<Result<usize, Error>>
Like
poll_write
, except that it writes from a slice of buffers. Read moresource§fn is_write_vectored(&self) -> bool
fn is_write_vectored(&self) -> bool
Determines if this writer has an efficient
poll_write_vectored
implementation. Read moresource§impl Debug for EitherStream
impl Debug for EitherStream
impl<'pin> Unpin for EitherStreamwhere
__EitherStream<'pin>: Unpin,
Auto Trait Implementations§
impl !Freeze for EitherStream
impl !RefUnwindSafe for EitherStream
impl Send for EitherStream
impl Sync for EitherStream
impl !UnwindSafe for EitherStream
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> TokioAsyncReadCompatExt for Twhere
T: AsyncRead,
impl<T> TokioAsyncReadCompatExt for Twhere
T: AsyncRead,
source§impl<T> TokioAsyncWriteCompatExt for Twhere
T: AsyncWrite,
impl<T> TokioAsyncWriteCompatExt for Twhere
T: AsyncWrite,
source§fn compat_write(self) -> Compat<Self>where
Self: Sized,
fn compat_write(self) -> Compat<Self>where
Self: Sized,
Wraps
self
with a compatibility layer that implements
futures_io::AsyncWrite
.