pub enum Command {
Simple(Vec<Assignment>, Vec<Word>, Vec<Redirect>),
Compound(Vec<Command>),
Not(Box<Command>),
And(Box<Command>, Box<Command>),
Or(Box<Command>, Box<Command>),
Subshell(Box<Program>),
Pipeline(Box<Command>, Box<Command>),
Background(Box<Command>),
Lang(Interpreter, String),
}
Expand description
A command is a highly mutually-recursive node with the main features of the POSIX language.
Variants§
Simple(Vec<Assignment>, Vec<Word>, Vec<Redirect>)
Compound(Vec<Command>)
A full program embedded in a compound command.
{ ls ; }
Not(Box<Command>)
Performs boolean negation to the status code of the inner command.
§Examples
! grep 'password' data.txt
And(Box<Command>, Box<Command>)
Perform the first command, conditionally running the next upon success.
§Examples
mkdir tmp && cd tmp
Or(Box<Command>, Box<Command>)
Perform the first command, conditionally running the next upon failure.
§Examples
kill $1 || kill -9 $1
Subshell(Box<Program>)
Pipeline(Box<Command>, Box<Command>)
Background(Box<Command>)
Lang(Interpreter, String)
Implementations§
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 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