pub struct TlsStream<S>(/* private fields */);Expand description
A wrapper around an underlying raw stream which implements the TLS or SSL protocol.
A TlsStream<S> represents a handshake that has been completed successfully
and both the server and the client are ready for receiving and sending
data. Bytes read from a TlsStream are decrypted from S and bytes written
to a TlsStream are encrypted when passing through to S.
Implementations§
Trait Implementations§
Source§impl<S> AsyncRead for TlsStream<S>
impl<S> AsyncRead for TlsStream<S>
Source§unsafe fn prepare_uninitialized_buffer(&self, _: &mut [MaybeUninit<u8>]) -> bool
unsafe fn prepare_uninitialized_buffer(&self, _: &mut [MaybeUninit<u8>]) -> bool
Prepares an uninitialized buffer to be safe to pass to
read. Returns
true if the supplied buffer was zeroed out. Read moreSource§impl<S> AsyncWrite for TlsStream<S>
impl<S> AsyncWrite for TlsStream<S>
Source§fn poll_write(
self: Pin<&mut TlsStream<S>>,
ctx: &mut Context<'_>,
buf: &[u8],
) -> Poll<Result<usize, Error>>
fn poll_write( self: Pin<&mut TlsStream<S>>, ctx: &mut Context<'_>, buf: &[u8], ) -> Poll<Result<usize, Error>>
Attempt to write bytes from
buf into the object. Read moreSource§fn poll_flush(
self: Pin<&mut TlsStream<S>>,
ctx: &mut Context<'_>,
) -> Poll<Result<(), Error>>
fn poll_flush( self: Pin<&mut TlsStream<S>>, ctx: &mut Context<'_>, ) -> Poll<Result<(), Error>>
Attempts to flush the object, ensuring that any buffered data reach
their destination. Read more
Auto Trait Implementations§
impl<S> Freeze for TlsStream<S>
impl<S> RefUnwindSafe for TlsStream<S>where
S: RefUnwindSafe,
impl<S> Send for TlsStream<S>where
S: Send,
impl<S> Sync for TlsStream<S>where
S: Sync,
impl<S> Unpin for TlsStream<S>where
S: Unpin,
impl<S> UnsafeUnpin for TlsStream<S>
impl<S> UnwindSafe for TlsStream<S>where
S: UnwindSafe,
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more