Struct SimplexStream
struct SimplexStream { ... }
A unidirectional pipe to read and write bytes in memory.
It can be constructed by simplex function which will create a pair of
reader and writer or by calling SimplexStream::new_unsplit that will
create a handle for both reading and writing.
Example
# async
Implementations
impl SimplexStream
fn new_unsplit(max_buf_size: usize) -> SimplexStreamCreates unidirectional buffer that acts like in memory pipe. To create split version with separate reader and writer you can use
simplexfunction.The
max_buf_sizeargument is the maximum amount of bytes that can be written to a buffer before the it returnsPoll::Pending.
impl AsyncRead for SimplexStream
fn poll_read(self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &mut ReadBuf<'_>) -> Poll<Result<()>>
impl AsyncWrite for SimplexStream
fn poll_write(self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &[u8]) -> Poll<Result<usize>>fn poll_write_vectored(self: Pin<&mut Self>, cx: &mut Context<'_>, bufs: &[IoSlice<'_>]) -> Poll<Result<usize, Error>>fn is_write_vectored(self: &Self) -> boolfn poll_flush(self: Pin<&mut Self>, _: &mut Context<'_>) -> Poll<Result<()>>fn poll_shutdown(self: Pin<&mut Self>, _: &mut Context<'_>) -> Poll<Result<()>>
impl Debug for SimplexStream
fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result
impl Freeze for SimplexStream
impl RefUnwindSafe for SimplexStream
impl Send for SimplexStream
impl Sync for SimplexStream
impl Unpin for SimplexStream
impl UnsafeUnpin for SimplexStream
impl UnwindSafe for SimplexStream
impl<R> AsyncReadExt for SimplexStream
impl<T> Any for SimplexStream
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for SimplexStream
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for SimplexStream
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> From for SimplexStream
fn from(t: T) -> TReturns the argument unchanged.
impl<T, U> Into for SimplexStream
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom for SimplexStream
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for SimplexStream
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>