pub struct Command { /* private fields */ }
Expand description
A process builder that allows you to spawn programs.
Implementations§
Source§impl Command
impl Command
Sourcepub fn new(program: impl ToString) -> Self
pub fn new(program: impl ToString) -> Self
Creates a new Command
that will spawn the provided program
.
Sourcepub fn with_shell(
shell_args: impl IntoIterator<Item = impl ToString>,
command: impl ToString,
) -> Self
pub fn with_shell( shell_args: impl IntoIterator<Item = impl ToString>, command: impl ToString, ) -> Self
Sourcepub fn args(
&mut self,
args: impl IntoIterator<Item = impl ToString>,
) -> &mut Self
pub fn args( &mut self, args: impl IntoIterator<Item = impl ToString>, ) -> &mut Self
Adds multiple arguments to the command.
Sourcepub fn env(&mut self, key: impl ToString, value: impl ToString) -> &mut Self
pub fn env(&mut self, key: impl ToString, value: impl ToString) -> &mut Self
Sets an environment variable that the process will spawn with.
Sourcepub fn envs<I, K, V>(&mut self, vars: I) -> &mut Self
pub fn envs<I, K, V>(&mut self, vars: I) -> &mut Self
Sets multiple environment variables that the process will spawn with.
Sourcepub fn unique(&mut self) -> &mut Self
pub fn unique(&mut self) -> &mut Self
Causes this command to only spawn the program if it is the only instance currently running.
Sourcepub fn once(&mut self) -> &mut Self
pub fn once(&mut self) -> &mut Self
Causes this command to spawn the program exactly once in the compositor’s lifespan.
Sourcepub fn pipe_stdin(&mut self) -> &mut Self
pub fn pipe_stdin(&mut self) -> &mut Self
Sets up a pipe to allow the config to write to the process’s stdin.
The pipe will be available through the spawned child’s stdin
.
Sourcepub fn pipe_stdout(&mut self) -> &mut Self
pub fn pipe_stdout(&mut self) -> &mut Self
Sets up a pipe to allow the config to read from the process’s stdout.
The pipe will be available through the spawned child’s stdout
.
Sourcepub fn pipe_stderr(&mut self) -> &mut Self
pub fn pipe_stderr(&mut self) -> &mut Self
Sets up a pipe to allow the config to read from the process’s stderr.
The pipe will be available through the spawned child’s stderr
.
Auto Trait Implementations§
impl Freeze for Command
impl RefUnwindSafe for Command
impl Send for Command
impl Sync for Command
impl Unpin for Command
impl UnwindSafe for Command
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request
§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered
].