pub struct DtactChildStdin(/* private fields */);Expand description
One end of a child process’s stdin pipe.
Exclusively owned by whoever holds it (returned by take_stdin on
DtactChild) — each async op temporarily moves the handle into a pool
closure and gets it back in the result, never shared behind a lock.
Implementations§
Source§impl DtactChildStdin
impl DtactChildStdin
Sourcepub async fn write(&mut self, buf: Vec<u8>) -> Result<(usize, Vec<u8>)>
pub async fn write(&mut self, buf: Vec<u8>) -> Result<(usize, Vec<u8>)>
Write buf to the child’s stdin on the process pool, returning
the number of bytes written and the buffer back for reuse.
§Errors
Returns whatever the underlying blocking Write::write on the
pipe returns (e.g. BrokenPipe if the child has already exited
and closed its end).
§Panics
Panics if called again while a previous call on the same &mut self hasn’t finished — in practice this is unreachable through
safe code: taking &mut self for the duration of the returned
future’s lifetime means a second call cannot start until the
first’s future has been driven to completion (or dropped), at
which point the handle has already been restored to Some.