Struct std::process::ChildStderr
1.0.0 · source · [−]pub struct ChildStderr { /* private fields */ }
Expand description
Trait Implementations
sourceimpl AsFd for ChildStderr
This is supported on Unix only.
impl AsFd for ChildStderr
sourceimpl AsHandle for ChildStderr
This is supported on Windows only.
impl AsHandle for ChildStderr
1.2.0 · sourceimpl AsRawFd for ChildStderr
This is supported on Unix only.
impl AsRawFd for ChildStderr
1.2.0 · sourceimpl AsRawHandle for ChildStderr
This is supported on Windows only.
impl AsRawHandle for ChildStderr
sourcefn as_raw_handle(&self) -> RawHandle
fn as_raw_handle(&self) -> RawHandle
Extracts the raw handle, without taking any ownership.
1.16.0 · sourceimpl Debug for ChildStderr
impl Debug for ChildStderr
sourceimpl From<ChildStderr> for OwnedFd
This is supported on Unix only.
impl From<ChildStderr> for OwnedFd
sourcefn from(child_stderr: ChildStderr) -> OwnedFd
fn from(child_stderr: ChildStderr) -> OwnedFd
Performs the conversion.
sourceimpl From<ChildStderr> for OwnedHandle
This is supported on Windows only.
impl From<ChildStderr> for OwnedHandle
sourcefn from(child_stderr: ChildStderr) -> OwnedHandle
fn from(child_stderr: ChildStderr) -> OwnedHandle
Performs the conversion.
1.20.0 · sourceimpl From<ChildStderr> for Stdio
impl From<ChildStderr> for Stdio
sourcefn from(child: ChildStderr) -> Stdio
fn from(child: ChildStderr) -> Stdio
Converts a ChildStderr
into a Stdio
Examples
use std::process::{Command, Stdio};
let reverse = Command::new("rev")
.arg("non_existing_file.txt")
.stderr(Stdio::piped())
.spawn()
.expect("failed reverse command");
let cat = Command::new("cat")
.arg("-")
.stdin(reverse.stderr.unwrap()) // Converted into a Stdio here
.output()
.expect("failed echo command");
assert_eq!(
String::from_utf8_lossy(&cat.stdout),
"rev: cannot open non_existing_file.txt: No such file or directory\n"
);
Run1.4.0 · sourceimpl IntoRawFd for ChildStderr
This is supported on Unix only.
impl IntoRawFd for ChildStderr
sourcefn into_raw_fd(self) -> RawFd
fn into_raw_fd(self) -> RawFd
Consumes this object, returning the raw underlying file descriptor. Read more
1.4.0 · sourceimpl IntoRawHandle for ChildStderr
This is supported on Windows only.
impl IntoRawHandle for ChildStderr
sourcefn into_raw_handle(self) -> RawHandle
fn into_raw_handle(self) -> RawHandle
Consumes this object, returning the raw underlying handle. Read more
sourceimpl Read for ChildStderr
impl Read for ChildStderr
sourcefn read(&mut self, buf: &mut [u8]) -> Result<usize>
fn read(&mut self, buf: &mut [u8]) -> Result<usize>
Pull some bytes from this source into the specified buffer, returning how many bytes were read. Read more
sourcefn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize>
fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize>
Like read
, except that it reads into a slice of buffers. Read more
sourcefn is_read_vectored(&self) -> bool
fn is_read_vectored(&self) -> bool
Determines if this Read
er has an efficient read_vectored
implementation. Read more
sourcefn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize>
fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize>
Read all bytes until EOF in this source, placing them into buf
. Read more
sourcefn read_to_string(&mut self, buf: &mut String) -> Result<usize>
fn read_to_string(&mut self, buf: &mut String) -> Result<usize>
Read all bytes until EOF in this source, appending them to buf
. Read more
1.6.0 · sourcefn read_exact(&mut self, buf: &mut [u8]) -> Result<()>
fn read_exact(&mut self, buf: &mut [u8]) -> Result<()>
Read the exact number of bytes required to fill buf
. Read more
sourcefn read_buf(&mut self, buf: &mut ReadBuf<'_>) -> Result<()>
fn read_buf(&mut self, buf: &mut ReadBuf<'_>) -> Result<()>
Pull some bytes from this source into the specified buffer. Read more
sourcefn read_buf_exact(&mut self, buf: &mut ReadBuf<'_>) -> Result<()>
fn read_buf_exact(&mut self, buf: &mut ReadBuf<'_>) -> Result<()>
Read the exact number of bytes required to fill buf
. Read more
sourcefn by_ref(&mut self) -> &mut Self where
Self: Sized,
fn by_ref(&mut self) -> &mut Self where
Self: Sized,
Creates a “by reference” adaptor for this instance of Read
. Read more
sourcefn bytes(self) -> Bytes<Self>ⓘNotable traits for Bytes<R>impl<R: Read> Iterator for Bytes<R> type Item = Result<u8>;
where
Self: Sized,
fn bytes(self) -> Bytes<Self>ⓘNotable traits for Bytes<R>impl<R: Read> Iterator for Bytes<R> type Item = Result<u8>;
where
Self: Sized,
Auto Trait Implementations
impl RefUnwindSafe for ChildStderr
impl Send for ChildStderr
impl Sync for ChildStderr
impl Unpin for ChildStderr
impl UnwindSafe for ChildStderr
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more