pub struct DtactStream { /* private fields */ }Expand description
One end of an in-process duplex pipe. Create a connected pair with
pair.
Implementations§
Source§impl DtactStream
impl DtactStream
Sourcepub fn poll_read(&self, cx: &Context<'_>, buf: &mut [u8]) -> Poll<Result<usize>>
pub fn poll_read(&self, cx: &Context<'_>, buf: &mut [u8]) -> Poll<Result<usize>>
Non-blocking poll-based read, usable directly from a hand-rolled
Future or via the async fn read convenience below.
Sourcepub fn poll_write(&self, cx: &Context<'_>, buf: &[u8]) -> Poll<Result<usize>>
pub fn poll_write(&self, cx: &Context<'_>, buf: &[u8]) -> Poll<Result<usize>>
Non-blocking poll-based write.
Sourcepub async fn read(&self, buf: &mut [u8]) -> Result<usize>
pub async fn read(&self, buf: &mut [u8]) -> Result<usize>
Read into buf, returning the number of bytes read (0 = EOF).
§Errors
Returns io::ErrorKind::BrokenPipe if the peer’s write half has
been dropped with no more buffered bytes to deliver (analogous to
EOF on a real pipe, surfaced as Ok(0) in that case — see
poll_read’s implementation — so in practice this async wrapper
itself only ever returns Ok; the Result exists for symmetry
with write/write_all and to leave room for future error paths).
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for DtactStream
impl !UnwindSafe for DtactStream
impl Freeze for DtactStream
impl Unpin for DtactStream
impl UnsafeUnpin for DtactStream
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