pub struct Or<F, S>{ /* private fields */ }
Expand description
Executes one command and if unsuccessful returns the result of the other.
Trait Implementations§
Source§impl<F: Command, S: Command> Command for Or<F, S>
impl<F: Command, S: Command> Command for Or<F, S>
Source§fn run_internal(
&self,
input: Option<&str>,
clear_env: bool,
env: HashMap<String, String>,
del_env: HashSet<String>,
path: Option<PathBuf>,
) -> Result<Output>
fn run_internal( &self, input: Option<&str>, clear_env: bool, env: HashMap<String, String>, del_env: HashSet<String>, path: Option<PathBuf>, ) -> Result<Output>
The command used to define all others.
input: the string to be piped into the next command run.
clear_env: if the global enviromental variables should be cleared.
env: what enviromental variables to set, supercedes clear_env.
Source§fn and<C: Command>(self, other: C) -> And<Self, C>
fn and<C: Command>(self, other: C) -> And<Self, C>
Equivalent to &&, as in “command 1” && “command 2”.
Source§fn or<C: Command>(self, other: C) -> Or<Self, C>
fn or<C: Command>(self, other: C) -> Or<Self, C>
Equivalent to ||, as in “command 1” || “command 2”.
Source§fn then<C: Command>(self, other: C) -> Then<Self, C>
fn then<C: Command>(self, other: C) -> Then<Self, C>
Equivalent to ;, as in “command 1”; “command 2”.
Source§fn pipe<C: Command>(self, other: C) -> Pipe<Self, C>
fn pipe<C: Command>(self, other: C) -> Pipe<Self, C>
Equivalent to |, as in “pipe 1” | “into 2”.
Source§fn env(self, key: &str, value: &str) -> Env<Self>
fn env(self, key: &str, value: &str) -> Env<Self>
Sets the env in the environment the command is run in.
Source§fn clear_envs(self) -> ClearEnv<Self>
fn clear_envs(self) -> ClearEnv<Self>
Clears the environment for non-explicitly set variables.
Source§fn without_env(self, key: &str) -> ExceptEnv<Self>
fn without_env(self, key: &str) -> ExceptEnv<Self>
Removes a variable from the enviroment in which the command is run.
Source§fn without_envs<I: IntoIterator<Item = String>>(
self,
envs: I,
) -> ExceptEnvs<Self, I>
fn without_envs<I: IntoIterator<Item = String>>( self, envs: I, ) -> ExceptEnvs<Self, I>
Takes an iterable of Strings for keys to remove.
fn with_dir<P: AsRef<Path>>(self, dir: P) -> Dir<Self>
Source§fn with_input(self, input: &str) -> Input<Self>
fn with_input(self, input: &str) -> Input<Self>
Pipes
input
into the following command.Auto Trait Implementations§
impl<F, S> Freeze for Or<F, S>
impl<F, S> RefUnwindSafe for Or<F, S>where
F: RefUnwindSafe,
S: RefUnwindSafe,
impl<F, S> Send for Or<F, S>
impl<F, S> Sync for Or<F, S>
impl<F, S> Unpin for Or<F, S>
impl<F, S> UnwindSafe for Or<F, S>where
F: UnwindSafe,
S: UnwindSafe,
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