pub struct Command {
pub program: String,
pub args: Vec<String>,
pub raw: String,
}Expand description
A resolved command: the program invoked and its arguments, plus the raw text of the line it came from.
Fields§
§program: StringThe program’s basename, with any wrapper (sudo, env, …) already
stripped and a path reduced to its final segment: /usr/bin/curl and
sudo curl both resolve to curl.
args: Vec<String>The argument vector, without the program itself. Quotes are removed and
VAR=value assignments dropped, so these are the values as the program
would receive them.
raw: StringThe raw source line this command came from, kept whole. Line-scoped predicates (redirections, pipes, markers that span tokens) test against this rather than the tokens, so a command extracted from a pipeline still sees the pipeline it sat in.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Command
impl RefUnwindSafe for Command
impl Send for Command
impl Sync for Command
impl Unpin for Command
impl UnsafeUnpin 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
Mutably borrows from an owned value. Read more