pub struct UotStream<T> { /* private fields */ }Expand description
Framed UoT stream.
This is a simple wrapper over the underlying IO source.
A Read call always waits for a complete frame, and then decapsulate it.
A Write call will encapsulate the buffer in a frame. It only ensures LEN is sent,
the left DATA may be partially sent, which requires subsequent Write calls
to finish sending the entire frame. Usually this could be achieved by write_all.
Implementations§
Trait Implementations§
Source§impl<T> AsyncWrite for UotStream<T>where
T: AsyncWrite + Unpin,
impl<T> AsyncWrite for UotStream<T>where
T: AsyncWrite + Unpin,
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<()>>
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<()>>
fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<()>>
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 moreAuto Trait Implementations§
impl<T> Freeze for UotStream<T>where
T: Freeze,
impl<T> RefUnwindSafe for UotStream<T>where
T: RefUnwindSafe,
impl<T> Send for UotStream<T>where
T: Send,
impl<T> Sync for UotStream<T>where
T: Sync,
impl<T> Unpin for UotStream<T>where
T: Unpin,
impl<T> UnwindSafe for UotStream<T>where
T: 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