#[non_exhaustive]pub enum Command {
Show 13 variants
Simple(SimpleCommand),
Subshell(SubshellCommand),
Group(GroupCommand),
If(IfCommand),
While(WhileCommand),
Until(UntilCommand),
For(ForCommand),
ArithFor(ArithForCommand),
FunctionDef(FunctionDef),
Case(CaseCommand),
DoubleBracket(DoubleBracketCommand),
ArithCommand(ArithCommandNode),
Select(SelectCommand),
}Expand description
A single command in the AST.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Simple(SimpleCommand)
A simple command with optional assignments, words, and redirections.
Subshell(SubshellCommand)
A ( compound_list ) subshell.
Group(GroupCommand)
A { compound_list ; } brace group.
If(IfCommand)
An if / elif / else / fi construct.
While(WhileCommand)
A while condition; do body; done loop.
Until(UntilCommand)
An until condition; do body; done loop.
For(ForCommand)
A for name in words; do body; done loop.
ArithFor(ArithForCommand)
A C-style for (( init; cond; step )) do body done loop.
FunctionDef(FunctionDef)
A function definition.
Case(CaseCommand)
A case word in ... esac statement.
DoubleBracket(DoubleBracketCommand)
A [[ expression ]] extended test.
ArithCommand(ArithCommandNode)
A (( expr )) arithmetic command.
Select(SelectCommand)
A select name in words; do body; done menu loop.
Trait Implementations§
impl StructuralPartialEq for Command
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