#[non_exhaustive]pub enum Redirection {
Capture,
Inherit,
Null,
File(File),
}Expand description
Where a child process’s stderr (or stdout, when supported) goes.
The default for Cmd::stderr() is Capture
— every error variant carries captured stderr, so that’s almost always
what production code wants. Use the other variants only when you have a
reason.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Capture
Capture into memory (default). Available in RunOutput.stderr on
success and in error variants on failure.
Inherit
Inherit the parent’s file descriptor. Output streams to the parent’s
stderr (i.e., the user’s terminal) instead of being captured.
Useful when the child should prompt the user (e.g., ssh password
prompts) or when the user should see live progress.
Null
Discard (/dev/null). Captured stderr will be empty.
File(File)
Redirect to a file. Captured stderr will be empty.
Trait Implementations§
Source§impl Debug for Redirection
impl Debug for Redirection
Source§impl Default for Redirection
impl Default for Redirection
Source§fn default() -> Redirection
fn default() -> Redirection
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for Redirection
impl RefUnwindSafe for Redirection
impl Send for Redirection
impl Sync for Redirection
impl Unpin for Redirection
impl UnsafeUnpin for Redirection
impl UnwindSafe for Redirection
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