pub struct ChildStdout {/* private fields */ }Expand description
Trait Implementations§
1.63.0 ·Source§implAsFd forChildStdout
Available onUnix only.
implAsFd forChildStdout
Available onUnix only.
Source§fnas_fd(&self) ->BorrowedFd<'_>
fnas_fd(&self) ->BorrowedFd<'_>
Available onUnix or HermitCore or
target_os=trusty or WASI ortarget_os=motor only.Borrows the file descriptor.Read more
1.63.0 ·Source§implAsHandle forChildStdout
Available onWindows only.
implAsHandle forChildStdout
Available onWindows only.
Source§fnas_handle(&self) ->BorrowedHandle<'_>
fnas_handle(&self) ->BorrowedHandle<'_>
Borrows the handle.Read more
1.2.0 ·Source§implAsRawFd forChildStdout
Available onUnix only.
implAsRawFd forChildStdout
Available onUnix only.
1.2.0 ·Source§implAsRawHandle forChildStdout
Available onWindows only.
implAsRawHandle forChildStdout
Available onWindows only.
Source§fnas_raw_handle(&self) ->RawHandle
fnas_raw_handle(&self) ->RawHandle
Extracts the raw handle.Read more
1.16.0 ·Source§implDebug forChildStdout
implDebug forChildStdout
1.63.0 ·Source§implFrom<ChildStdout> forOwnedFd
Available onUnix only.
implFrom<ChildStdout> forOwnedFd
Available onUnix only.
Source§fnfrom(child_stdout:ChildStdout) ->OwnedFd
fnfrom(child_stdout:ChildStdout) ->OwnedFd
Takes ownership of aChildStdout’s file descriptor.
1.63.0 ·Source§implFrom<ChildStdout> forOwnedHandle
Available onWindows only.
implFrom<ChildStdout> forOwnedHandle
Available onWindows only.
Source§fnfrom(child_stdout:ChildStdout) ->OwnedHandle
fnfrom(child_stdout:ChildStdout) ->OwnedHandle
Takes ownership of aChildStdout’s file handle.
1.20.0 ·Source§implFrom<ChildStdout> forStdio
implFrom<ChildStdout> forStdio
Source§fnfrom(child:ChildStdout) ->Stdio
fnfrom(child:ChildStdout) ->Stdio
Converts aChildStdout into aStdio.
§Examples
ChildStdout will be converted toStdio usingStdio::from under the hood.
usestd::process::{Command, Stdio};lethello = Command::new("echo") .arg("Hello, world!") .stdout(Stdio::piped()) .spawn() .expect("failed echo command");letreverse = Command::new("rev") .stdin(hello.stdout.unwrap())// Converted into a Stdio here.output() .expect("failed reverse command");assert_eq!(reverse.stdout,b"!dlrow ,olleH\n");1.74.0 ·Source§implFrom<OwnedFd> forChildStdout
Available onUnix only.Creates aChildStdout from the providedOwnedFd.
implFrom<OwnedFd> forChildStdout
Available onUnix only.
Creates aChildStdout from the providedOwnedFd.
The provided file descriptor must point to a pipewith theCLOEXEC flag set.
1.74.0 ·Source§implFrom<OwnedHandle> forChildStdout
Available onWindows only.Creates aChildStdout from the providedOwnedHandle.
implFrom<OwnedHandle> forChildStdout
Available onWindows only.
Creates aChildStdout from the providedOwnedHandle.
The provided handle must be asynchronous, as reading andwriting from and to it is implemented using asynchronous APIs.
Source§fnfrom(handle:OwnedHandle) ->ChildStdoutⓘ
fnfrom(handle:OwnedHandle) ->ChildStdoutⓘ
Converts to this type from the input type.
1.4.0 ·Source§implIntoRawFd forChildStdout
Available onUnix only.
implIntoRawFd forChildStdout
Available onUnix only.
Source§fninto_raw_fd(self) ->RawFd
fninto_raw_fd(self) ->RawFd
Available onUnix or HermitCore or
target_os=trusty or WASI ortarget_os=motor only.Consumes this object, returning the raw underlying file descriptor.Read more
1.4.0 ·Source§implIntoRawHandle forChildStdout
Available onWindows only.
implIntoRawHandle forChildStdout
Available onWindows only.
Source§fninto_raw_handle(self) ->RawHandle
fninto_raw_handle(self) ->RawHandle
Consumes this object, returning the raw underlying handle.Read more
1.0.0 ·Source§implRead forChildStdout
implRead forChildStdout
Source§fnread(&mut self, buf: &mut [u8]) ->Result<usize>
fnread(&mut self, buf: &mut [u8]) ->Result<usize>
Pull some bytes from this source into the specified buffer, returninghow many bytes were read.Read more
Source§fnread_buf(&mut self, buf:BorrowedCursor<'_>) ->Result<()>
fnread_buf(&mut self, buf:BorrowedCursor<'_>) ->Result<()>
🔬This is a nightly-only experimental API. (
read_buf #78485)Pull some bytes from this source into the specified buffer.Read more
Source§fnread_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) ->Result<usize>
fnread_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) ->Result<usize>
Like
read, except that it reads into a slice of buffers.Read moreSource§fnis_read_vectored(&self) ->bool
fnis_read_vectored(&self) ->bool
🔬This is a nightly-only experimental API. (
can_vector #69941)Source§fnread_to_end(&mut self, buf: &mutVec<u8>) ->Result<usize>
fnread_to_end(&mut self, buf: &mutVec<u8>) ->Result<usize>
Reads all bytes until EOF in this source, placing them into
buf.Read more1.0.0 ·Source§fnread_to_string(&mut self, buf: &mutString) ->Result<usize>
fnread_to_string(&mut self, buf: &mutString) ->Result<usize>
Reads all bytes until EOF in this source, appending them to
buf.Read more1.6.0 ·Source§fnread_exact(&mut self, buf: &mut [u8]) ->Result<()>
fnread_exact(&mut self, buf: &mut [u8]) ->Result<()>
Reads the exact number of bytes required to fill
buf.Read moreSource§fnread_buf_exact(&mut self, cursor:BorrowedCursor<'_>) ->Result<()>
fnread_buf_exact(&mut self, cursor:BorrowedCursor<'_>) ->Result<()>
🔬This is a nightly-only experimental API. (
read_buf #78485)Reads the exact number of bytes required to fill
cursor.Read more1.0.0 ·Source§fnby_ref(&mut self) -> &mut Selfwhere Self:Sized,
fnby_ref(&mut self) -> &mut Selfwhere Self:Sized,
Creates a “by reference” adapter for this instance of
Read.Read more1.0.0 ·Source§fnchain<R:Read>(self, next: R) ->Chain<Self, R>ⓘwhere Self:Sized,
fnchain<R:Read>(self, next: R) ->Chain<Self, R>ⓘwhere Self:Sized,
Creates an adapter which will chain this stream with another.Read more
Auto Trait Implementations§
implFreeze forChildStdout
implRefUnwindSafe forChildStdout
implSend forChildStdout
implSync forChildStdout
implUnpin forChildStdout
implUnwindSafe forChildStdout
Blanket Implementations§
Source§impl<T>BorrowMut<T> for Twhere T: ?Sized,
impl<T>BorrowMut<T> for Twhere T: ?Sized,
Source§fnborrow_mut(&mut self) ->&mut T
fnborrow_mut(&mut self) ->&mut T
Mutably borrows from an owned value.Read more