pub enum AsyncTcpStream {
Plain(Pin<Box<dyn AsyncIOHandle + Send>>),
TLS(Pin<Box<dyn AsyncIOHandle + Send>>),
}
Expand description
Re-export TcpStream Wrapper around plain or TLS async TCP streams
Variants§
Plain(Pin<Box<dyn AsyncIOHandle + Send>>)
Wrapper around plain async TCP stream
TLS(Pin<Box<dyn AsyncIOHandle + Send>>)
Wrapper around a TLS async TCP stream
Implementations§
Source§impl AsyncTcpStream
impl AsyncTcpStream
Sourcepub async fn connect<R, A>(reactor: R, addr: A) -> Result<AsyncTcpStream, Error>
pub async fn connect<R, A>(reactor: R, addr: A) -> Result<AsyncTcpStream, Error>
Wrapper around reactor_trait::TcpReactor::connect
Sourcepub async fn into_tls(
self,
domain: &str,
config: TLSConfig<'_, '_, '_>,
) -> Result<AsyncTcpStream, Error>
pub async fn into_tls( self, domain: &str, config: TLSConfig<'_, '_, '_>, ) -> Result<AsyncTcpStream, Error>
Enable TLS
Sourcepub async fn into_rustls(
self,
connector: &RustlsConnector,
domain: &str,
) -> Result<AsyncTcpStream, Error>
pub async fn into_rustls( self, connector: &RustlsConnector, domain: &str, ) -> Result<AsyncTcpStream, Error>
Enable TLS using rustls
Trait Implementations§
Source§impl AsyncRead for AsyncTcpStream
impl AsyncRead for AsyncTcpStream
Source§impl AsyncWrite for AsyncTcpStream
impl AsyncWrite for AsyncTcpStream
Source§fn poll_write(
self: Pin<&mut AsyncTcpStream>,
cx: &mut Context<'_>,
buf: &[u8],
) -> Poll<Result<usize, Error>>
fn poll_write( self: Pin<&mut AsyncTcpStream>, 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>,
cx: &mut Context<'_>,
bufs: &[IoSlice<'_>],
) -> Poll<Result<usize, Error>>
fn poll_write_vectored( self: Pin<&mut AsyncTcpStream>, 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 Freeze for AsyncTcpStream
impl !RefUnwindSafe for AsyncTcpStream
impl Send for AsyncTcpStream
impl !Sync for AsyncTcpStream
impl Unpin for AsyncTcpStream
impl !UnwindSafe for AsyncTcpStream
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