#[non_exhaustive]pub enum AsyncTcpStream<S>{
Plain(S),
Rustls(TlsStream<S>),
}
Expand description
Re-export TcpStream Wrapper around plain or TLS async TCP streams
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Plain(S)
Wrapper around plain async TCP stream
Rustls(TlsStream<S>)
Wrapper around a TLS async stream hanled by rustls
Implementations§
Source§impl<S> AsyncTcpStream<S>
impl<S> AsyncTcpStream<S>
Sourcepub async fn connect<R, A>(
reactor: &R,
addr: A,
) -> Result<AsyncTcpStream<S>, Error>
pub async fn connect<R, A>( reactor: &R, addr: A, ) -> Result<AsyncTcpStream<S>, Error>
Wrapper around reactor_trait::TcpReactor::connect
Sourcepub async fn into_tls(
self,
domain: &str,
config: TLSConfig<'_, '_, '_>,
) -> Result<AsyncTcpStream<S>, Error>
pub async fn into_tls( self, domain: &str, config: TLSConfig<'_, '_, '_>, ) -> Result<AsyncTcpStream<S>, Error>
Enable TLS
Sourcepub async fn into_rustls(
self,
connector: &RustlsConnector,
domain: &str,
) -> Result<AsyncTcpStream<S>, Error>
pub async fn into_rustls( self, connector: &RustlsConnector, domain: &str, ) -> Result<AsyncTcpStream<S>, Error>
Enable TLS using rustls
Trait Implementations§
Source§impl<S> AsyncRead for AsyncTcpStream<S>
impl<S> AsyncRead for AsyncTcpStream<S>
Source§impl<S> AsyncWrite for AsyncTcpStream<S>
impl<S> AsyncWrite for AsyncTcpStream<S>
Source§fn poll_write(
self: Pin<&mut AsyncTcpStream<S>>,
cx: &mut Context<'_>,
buf: &[u8],
) -> Poll<Result<usize, Error>>
fn poll_write( self: Pin<&mut AsyncTcpStream<S>>, cx: &mut Context<'_>, buf: &[u8], ) -> Poll<Result<usize, Error>>
Attempt to write bytes from
buf
into the object. Read moreSource§fn poll_write_vectored(
self: Pin<&mut AsyncTcpStream<S>>,
cx: &mut Context<'_>,
bufs: &[IoSlice<'_>],
) -> Poll<Result<usize, Error>>
fn poll_write_vectored( self: Pin<&mut AsyncTcpStream<S>>, cx: &mut Context<'_>, bufs: &[IoSlice<'_>], ) -> Poll<Result<usize, Error>>
Attempt to write bytes from
bufs
into the object using vectored
IO operations. Read moreAuto Trait Implementations§
impl<S> Freeze for AsyncTcpStream<S>where
S: Freeze,
impl<S> !RefUnwindSafe for AsyncTcpStream<S>
impl<S> Send for AsyncTcpStream<S>
impl<S> Sync for AsyncTcpStream<S>where
S: Sync,
impl<S> Unpin for AsyncTcpStream<S>
impl<S> !UnwindSafe for AsyncTcpStream<S>
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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