pub struct ConnStream { /* private fields */ }Expand description
Wraps a ConnCtx and implements futures_io::{AsyncRead, AsyncWrite, AsyncBufRead}.
Wraps a ConnCtx and implements AsyncRead, AsyncWrite, and
AsyncBufRead.
Created via ConnStream::new. The inner ConnCtx is still accessible
via conn_ctx for operations that have no trait
equivalent (e.g. connect, shutdown_write).
§Copy profile
| Trait method | Copies (recv) | Mechanism |
|---|---|---|
AsyncRead::poll_read | 1 | accumulator → caller buf |
AsyncBufRead::poll_fill_buf | 0 | refcounted Bytes slice |
AsyncWrite::poll_write | 1 | caller buf → send pool |
Implementations§
Source§impl ConnStream
impl ConnStream
Sourcepub fn conn_ctx(&self) -> ConnCtx
pub fn conn_ctx(&self) -> ConnCtx
Borrow the inner ConnCtx.
Useful for operations without a trait equivalent, such as
ConnCtx::connect or ConnCtx::peer_addr.
Trait Implementations§
Source§impl AsyncBufRead for ConnStream
impl AsyncBufRead for ConnStream
Source§impl AsyncRead for ConnStream
impl AsyncRead for ConnStream
Source§impl AsyncWrite for ConnStream
impl AsyncWrite for ConnStream
Source§fn poll_write(
self: Pin<&mut Self>,
_cx: &mut Context<'_>,
buf: &[u8],
) -> Poll<Result<usize>>
fn poll_write( self: Pin<&mut Self>, _cx: &mut Context<'_>, buf: &[u8], ) -> Poll<Result<usize>>
Attempt to write bytes from
buf into the object. Read moreSource§fn poll_flush(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<Result<()>>
fn poll_flush(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<Result<()>>
Attempt to flush the object, ensuring that any buffered data reach
their destination. Read more
Auto Trait Implementations§
impl !Freeze for ConnStream
impl RefUnwindSafe for ConnStream
impl Send for ConnStream
impl Sync for ConnStream
impl Unpin for ConnStream
impl UnsafeUnpin for ConnStream
impl UnwindSafe for ConnStream
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