Struct SimplexStream
pub struct SimplexStream { /* private fields */ }
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 it returnsPoll::Pending.
Trait Implementations
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) -> 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, f: &mut Formatter<'_>) -> Result
Auto Trait Implementations
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
Blanket Implementations
impl<R> AsyncReadExt for SimplexStream
where
R: AsyncRead + ?Sized,
impl<T> Any for SimplexStream
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for SimplexStream
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for SimplexStream
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> From<T> for SimplexStream
fn from(t: T) -> TReturns the argument unchanged.
impl<T, U> Into<U> for SimplexStream
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for SimplexStream
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for SimplexStream
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>