pub enum Cmd {
Simple(SimpleCmd),
Subshell {
body: Script,
redirs: Vec<Redir>,
},
BraceGroup {
body: Script,
redirs: Vec<Redir>,
},
For {
var: String,
items: Vec<Word>,
body: Script,
redirs: Vec<Redir>,
},
While {
cond: Script,
body: Script,
redirs: Vec<Redir>,
},
Until {
cond: Script,
body: Script,
redirs: Vec<Redir>,
},
If {
branches: Vec<Branch>,
else_body: Option<Script>,
redirs: Vec<Redir>,
},
DoubleBracket {
words: Vec<Word>,
redirs: Vec<Redir>,
},
Case {
subject: Word,
arms: Vec<CaseArm>,
redirs: Vec<Redir>,
},
FunctionDef {
name: String,
body: Script,
},
}Variants§
Simple(SimpleCmd)
Subshell
BraceGroup
For
While
Until
If
DoubleBracket
Case
case WORD in PATTERN) BODY ;; … esac (POSIX 2.9.4.3). Which arm runs depends on a value
resolved at runtime, so — like Cmd::If — every arm body is classified and the command
is only as safe as its worst arm.
FunctionDef
name() { body } (or function name { body }). Defining a function has NO effect — it is
classified Inert. The body’s safety matters only when the function is CALLED (resolved in
check), so it is stored, not flattened.
Trait Implementations§
impl Eq for Cmd
impl StructuralPartialEq for Cmd
Auto Trait Implementations§
impl Freeze for Cmd
impl RefUnwindSafe for Cmd
impl Send for Cmd
impl Sync for Cmd
impl Unpin for Cmd
impl UnsafeUnpin for Cmd
impl UnwindSafe for Cmd
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
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§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
Compare self to
key and return true if they are equal.