pub struct ShellCommand { /* private fields */ }Expand description
One command line a script would run, with its words unquoted.
Implementations§
Source§impl ShellCommand
impl ShellCommand
Sourcepub fn argv(&self) -> &[String]
pub fn argv(&self) -> &[String]
The program and its arguments, quotes removed. A word part computed at run time contributes nothing to its word.
Sourcepub fn program(&self) -> &str
pub fn program(&self) -> &str
The program’s file name, lower-cased and without a Windows
executable suffix: /usr/bin/PKILL.exe is pkill.
Sourcepub const fn is_background(&self) -> bool
pub const fn is_background(&self) -> bool
Whether the command sits in an &-asynchronous position, so the
script does not wait on it. Everything nested in a detached command
is detached as well.
Sourcepub const fn line(&self) -> LineId
pub const fn line(&self) -> LineId
The simple command, as written, this command belongs to: the command itself, or the wrapper that runs it.
Sourcepub const fn wrapper(&self) -> Option<CommandId>
pub const fn wrapper(&self) -> Option<CommandId>
The command that runs this one from its own arguments: env,
sudo, timeout, xargs, find -exec and the like.
Sourcepub const fn interpreter(&self) -> Option<CommandId>
pub const fn interpreter(&self) -> Option<CommandId>
The shell or eval command that runs this one from a script string
(sh -c, eval, or a shell reading a here-document).
Sourcepub const fn substituted_into(&self) -> Option<LineId>
pub const fn substituted_into(&self) -> Option<LineId>
The command line whose words this command’s output is substituted
into, through a command or process substitution, the nearest one when
substitutions nest: kill $(pgrep foo) substitutes pgrep into the
kill line.
Sourcepub const fn pipeline(&self) -> Option<PipelineStage>
pub const fn pipeline(&self) -> Option<PipelineStage>
Where the command’s line sits in a pipeline of two or more commands; a wrapped command shares its wrapper’s stage.
Trait Implementations§
Source§impl Clone for ShellCommand
impl Clone for ShellCommand
Source§impl Debug for ShellCommand
impl Debug for ShellCommand
impl Eq for ShellCommand
Source§impl PartialEq for ShellCommand
impl PartialEq for ShellCommand
impl StructuralPartialEq for ShellCommand
Auto Trait Implementations§
impl Forget for ShellCommand
impl Freeze for ShellCommand
impl Move for ShellCommand
impl RefUnwindSafe for ShellCommand
impl Send for ShellCommand
impl Sync for ShellCommand
impl Unpin for ShellCommand
impl UnsafeUnpin for ShellCommand
impl UnwindSafe for ShellCommand
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more