pub struct ChildStdin { /* private fields */ }Expand description
Async handle to the child’s standard input.
Implements AsyncWrite for sending data to the child.
§Example
ⓘ
use asupersync::io::AsyncWriteExt;
let mut child = Command::new("cat")
.stdin(Stdio::piped())
.stdout(Stdio::piped())
.spawn()?;
if let Some(mut stdin) = child.stdin() {
stdin.write_all(b"hello\n").await?;
}Implementations§
Trait Implementations§
Source§impl AsyncWrite for ChildStdin
impl AsyncWrite for ChildStdin
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 data from
buf.Source§fn poll_flush(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<Result<()>>
fn poll_flush(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<Result<()>>
Attempt to flush buffered data.
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<()>>
Attempt to shutdown the writer.
Source§fn poll_write_vectored(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
bufs: &[IoSlice<'_>],
) -> Poll<Result<usize>>
fn poll_write_vectored( self: Pin<&mut Self>, cx: &mut Context<'_>, bufs: &[IoSlice<'_>], ) -> Poll<Result<usize>>
Attempt to write data from multiple buffers (vectored I/O).
Source§fn is_write_vectored(&self) -> bool
fn is_write_vectored(&self) -> bool
Returns whether this writer has efficient vectored writes.
Auto Trait Implementations§
impl Freeze for ChildStdin
impl RefUnwindSafe for ChildStdin
impl Send for ChildStdin
impl Sync for ChildStdin
impl Unpin for ChildStdin
impl UnwindSafe for ChildStdin
Blanket Implementations§
Source§impl<W> AsyncWriteExt for Wwhere
W: AsyncWrite + ?Sized,
impl<W> AsyncWriteExt for Wwhere
W: AsyncWrite + ?Sized,
Source§fn write_all<'a>(&'a mut self, buf: &'a [u8]) -> WriteAll<'a, Self> ⓘwhere
Self: Unpin,
fn write_all<'a>(&'a mut self, buf: &'a [u8]) -> WriteAll<'a, Self> ⓘwhere
Self: Unpin,
Write all bytes from
buf.Source§fn write_all_buf<'a, B>(
&'a mut self,
buf: &'a mut B,
) -> WriteAllBuf<'a, Self, B> ⓘ
fn write_all_buf<'a, B>( &'a mut self, buf: &'a mut B, ) -> WriteAllBuf<'a, Self, B> ⓘ
Write all bytes from a buffer.
Source§fn write_vectored<'a>(
&'a mut self,
bufs: &'a [IoSlice<'a>],
) -> WriteVectored<'a, Self> ⓘwhere
Self: Unpin,
fn write_vectored<'a>(
&'a mut self,
bufs: &'a [IoSlice<'a>],
) -> WriteVectored<'a, Self> ⓘwhere
Self: Unpin,
Write data from multiple buffers (vectored I/O).
Source§impl<W> AsyncWriteVectored for Wwhere
W: AsyncWrite + ?Sized,
impl<W> AsyncWriteVectored for Wwhere
W: AsyncWrite + ?Sized,
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).