pub enum Command {
Exec {
prog: String,
args: Vec<String>,
},
Shell {
shell: Shell,
args: Vec<String>,
command: String,
},
}
Expand description
A command to execute.
Variants
Exec
A raw command which will be executed as-is.
Shell
Fields
shell: Shell
The shell to run.
args: Vec<String>
Additional options or arguments to pass to the shell.
These will be inserted before the -c
(or equivalent) option immediately preceding the
command line string.
command: String
The command line to pass to the shell.
A shelled command line.
Implementations
sourceimpl Command
impl Command
sourcepub fn to_spawnable(&self) -> Result<TokioCommand, RuntimeError>
pub fn to_spawnable(&self) -> Result<TokioCommand, RuntimeError>
Obtain a tokio::process::Command
from a Command
.
Behaves as described in the Command
and Shell
documentation.
Errors
- Errors if the
command
of aCommand::Shell
is empty. - Errors if the
shell
of aShell::Unix(shell)
is empty.
Trait Implementations
sourceimpl PartialEq<Command> for Command
impl PartialEq<Command> for Command
impl Eq for Command
impl StructuralEq for Command
impl StructuralPartialEq for Command
Auto Trait Implementations
impl RefUnwindSafe for Command
impl Send for Command
impl Sync for Command
impl Unpin for Command
impl UnwindSafe for Command
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more