pub enum CompoundCommandKind<V, W, C> {
Brace(Vec<C>),
Subshell(Vec<C>),
While(GuardBodyPair<C>),
Until(GuardBodyPair<C>),
If {
conditionals: Vec<GuardBodyPair<C>>,
else_branch: Option<Vec<C>>,
},
For {
var: V,
words: Option<Vec<W>>,
body: Vec<C>,
},
Case {
word: W,
arms: Vec<PatternBodyPair<W, C>>,
},
}
Expand description
A specific kind of a CompoundCommand
.
Generic over the representation of shell words and commands.
Variants§
Brace(Vec<C>)
A group of commands that should be executed in the current environment.
Subshell(Vec<C>)
A group of commands that should be executed in a subshell environment.
While(GuardBodyPair<C>)
A command that executes its body as long as its guard exits successfully.
Until(GuardBodyPair<C>)
A command that executes its body as until as its guard exits unsuccessfully.
If
A conditional command that runs the respective command branch when a certain of the first condition that exits successfully.
Fields
conditionals: Vec<GuardBodyPair<C>>
A list of conditional branch-body pairs.
For
A command that binds a variable to a number of provided words and runs its body once for each binding.
Fields
var: V
The variable to bind to each of the specified words.
Case
A command that behaves much like a match
statment in Rust, running
a branch of commands if a specified word matches another literal or
glob pattern.
Fields
word: W
The word on which to check for pattern matches.
arms: Vec<PatternBodyPair<W, C>>
The arms to match against.
Trait Implementations§
Source§impl<V: Clone, W: Clone, C: Clone> Clone for CompoundCommandKind<V, W, C>
impl<V: Clone, W: Clone, C: Clone> Clone for CompoundCommandKind<V, W, C>
Source§fn clone(&self) -> CompoundCommandKind<V, W, C>
fn clone(&self) -> CompoundCommandKind<V, W, C>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<V: PartialEq, W: PartialEq, C: PartialEq> PartialEq for CompoundCommandKind<V, W, C>
impl<V: PartialEq, W: PartialEq, C: PartialEq> PartialEq for CompoundCommandKind<V, W, C>
Source§fn eq(&self, other: &CompoundCommandKind<V, W, C>) -> bool
fn eq(&self, other: &CompoundCommandKind<V, W, C>) -> bool
self
and other
values to be equal, and is used by ==
.