pub enum StepKind {
Show 54 variants
Workdir(Arg),
Workspace(WorkspaceTarget),
Env {
key: String,
value: Arg,
},
InheritEnv {
keys: Vec<String>,
},
Echo(Arg),
Run(Arg),
Copy {
from_workspace: Option<WorkspaceTarget>,
from_host: bool,
to_host: bool,
from: Arg,
to: Arg,
},
CopyGit {
rev: Arg,
from: Arg,
to: Arg,
include_dirty: bool,
},
Symlink {
from_workspace: Option<WorkspaceTarget>,
from: Arg,
to: Arg,
},
Mkdir(Arg),
Install {
from: Arg,
to: Arg,
},
SetExecutable {
path: Arg,
},
Archive {
src: Arg,
dst: Arg,
raw: bool,
},
Unarchive {
src: Arg,
dst: Arg,
max_bytes: Option<Arg>,
},
Ls(Option<Arg>),
Read(Option<Arg>),
ReadLine {
var: String,
},
Prompt {
var: String,
message: Arg,
default: Option<Arg>,
},
Write {
path: Arg,
contents: Option<Arg>,
},
Append {
path: Arg,
contents: Option<Arg>,
},
AppendLine {
path: Arg,
contents: Arg,
},
Remove {
path: Arg,
recursive: bool,
},
Expand {
path: Option<Arg>,
overrides: Vec<(String, Arg)>,
},
AssertEq {
hash: Option<String>,
actual: AssertTarget,
expected: Option<Arg>,
},
AssertNe {
hash: Option<String>,
actual: AssertTarget,
expected: Option<Arg>,
},
AssertContains {
haystack: AssertTarget,
needle: Arg,
},
Exit(Arg),
Sleep {
duration: Arg,
},
ListAppend {
list: String,
item: Arg,
},
WithIo {
bindings: Vec<IoBinding>,
cmd: Box<StepKind>,
},
WithIoBlock {
bindings: Vec<IoBinding>,
},
TypeAlias {
name: String,
target: String,
},
For {
key_var: Option<String>,
key_type: Option<String>,
var: String,
var_type: String,
in_expr: Expr,
body: Vec<Step>,
},
If {
cond: Box<Expr>,
then_body: Vec<Step>,
else_ifs: Vec<(Box<Expr>, Vec<Step>)>,
else_body: Option<Vec<Step>>,
},
Switch {
discriminant: Option<Box<Expr>>,
cases: Vec<(Vec<Expr>, Vec<Step>)>,
default_body: Option<Vec<Step>>,
},
Bind {
var: String,
decl_type: String,
is_const: bool,
rhs: BindRhs,
},
Set {
var: String,
expr: Expr,
},
AsyncBlock {
body: Vec<Step>,
},
Await {
var: String,
},
Cancel {
var: String,
},
Timeout {
duration: Arg,
body: Vec<Step>,
},
Fail {
code: Option<Arg>,
message: Option<Arg>,
body: Vec<Step>,
},
Isolated {
body: Vec<Step>,
},
IsolatedInheritEnv {
keys: Vec<String>,
},
RemoteBlock {
target: String,
vars: Vec<String>,
env: Vec<String>,
body: Vec<Step>,
},
RunExec {
argv: Vec<Arg>,
},
FuncDef {
name: String,
params: Vec<(String, String, bool)>,
return_type: String,
is_async: bool,
body: Vec<Step>,
docs: Option<(String, String)>,
},
Call {
name: String,
args: Vec<Expr>,
},
Return {
expr: Box<Expr>,
is_bare: bool,
},
ImportFile {
path: String,
alias: String,
},
ImportFuncs {
path: String,
alias: Option<String>,
func_names: Vec<String>,
type_names: Vec<String>,
},
While {
cond: Box<Expr>,
body: Vec<Step>,
},
Break,
Continue,
}Variants§
Workdir(Arg)
Workspace(WorkspaceTarget)
Env
InheritEnv
Echo(Arg)
Run(Arg)
Copy
CopyGit
Symlink
Mkdir(Arg)
Install
SetExecutable
Archive
Unarchive
Ls(Option<Arg>)
Read(Option<Arg>)
ReadLine
Prompt
Write
Append
AppendLine
Remove
Expand
AssertEq
AssertNe
AssertContains
Exit(Arg)
Sleep
ListAppend
WithIo
WithIoBlock
TypeAlias
For
Fields
If
Fields
Switch
Fields
Bind
Set
AsyncBlock
Await
Cancel
Timeout
Fail
Isolated
IsolatedInheritEnv
RemoteBlock
RunExec
FuncDef
Fields
Call
Return
ImportFile
ImportFuncs
While
Break
Continue
Implementations§
Source§impl StepKind
impl StepKind
Sourcepub fn walk_exprs(&self, f: &mut impl FnMut(&Expr))
pub fn walk_exprs(&self, f: &mut impl FnMut(&Expr))
Visit every immediate child expression (arguments, conditions,
durations, initializers). Boxed sub-kinds and bodies are NOT
descended: pair with walk_child_kinds
or use walk_step_exprs for the full
tree. Exhaustive: a new variant fails compilation here, so AST
passes built on this visitor can never silently miss a command.
Sourcepub fn walk_exprs_mut(&mut self, f: &mut impl FnMut(&mut Expr))
pub fn walk_exprs_mut(&mut self, f: &mut impl FnMut(&mut Expr))
Mutable twin of walk_exprs: visits every
immediate child expression mutably. Bodies are NOT descended,
matching the immutable boundary: the parse-time placeholder
qualifier recurses per statement with its own frames.
Exhaustive for the same reason: new expression carriers fail
compilation here.
Sourcepub fn walk_raw_strings(&self, f: &mut impl FnMut(&str))
pub fn walk_raw_strings(&self, f: &mut impl FnMut(&str))
Visit every immediate raw string fragment (literal argument text
and mixed-value text fragments). Typed expressions are NOT
visited here. Boxed sub-kinds and bodies are NOT descended, same
as walk_exprs: the caller recurses through
walk_child_kinds or the checker’s own
body walk. Exhaustive for the same reason: a new string-carrying
variant must appear here or env-template checking misses it.
Sourcepub fn walk_raw_strings_mut(&mut self, f: &mut impl FnMut(&mut String))
pub fn walk_raw_strings_mut(&mut self, f: &mut impl FnMut(&mut String))
Mutable twin of walk_raw_strings:
same fragments, same non-descending boundary. The parse-time
placeholder qualifier runs through this; the static env check
runs through the shared twin, so both agree fragment for fragment.
Sourcepub fn walk_child_kinds(&self, f: &mut impl FnMut(&StepKind))
pub fn walk_child_kinds(&self, f: &mut impl FnMut(&StepKind))
Visit every immediate child kind: boxed sub-commands and the kinds
of every body step. Exhaustive like walk_exprs:
new block shapes fail compilation here.
Sourcepub fn walk_step_exprs(&self, f: &mut impl FnMut(&Expr))
pub fn walk_step_exprs(&self, f: &mut impl FnMut(&Expr))
Visit every descendant expression in the full subtree: immediate
expressions (deep via Expr::walk) plus
every nested body and boxed sub-command. The single traversal every
AST inspection pass should use.
Trait Implementations§
impl StructuralPartialEq for StepKind
Auto Trait Implementations§
impl Forget for StepKind
impl Freeze for StepKindwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
&'static TypeDescriptor: Freeze,
*mut (): Freeze,
PhantomData<String>: Freeze,
PhantomData<Expr>: Freeze,
PhantomData<(String, Expr)>: Freeze,
PhantomData<Step>: Freeze,
*const Expr is !null: Freeze,
PhantomData<MathOp>: Freeze,
PhantomData<ArgPart>: Freeze,
PhantomData<(String, Arg)>: Freeze,
PhantomData<IoBinding>: Freeze,
*const StepKind is !null: Freeze,
PhantomData<StepKind>: Freeze,
PhantomData<(Box<Expr>, Vec<Step>)>: Freeze,
PhantomData<(Vec<Expr>, Vec<Step>)>: Freeze,
PhantomData<Arg>: Freeze,
PhantomData<(String, String, bool)>: Freeze,
impl Move for StepKind
impl RefUnwindSafe for StepKind
impl Send for StepKind
impl Sync for StepKind
impl Unpin for StepKind
impl UnsafeUnpin for StepKindwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
&'static TypeDescriptor: UnsafeUnpin,
*mut (): UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
PhantomData<Expr>: UnsafeUnpin,
PhantomData<(String, Expr)>: UnsafeUnpin,
PhantomData<Step>: UnsafeUnpin,
*const Expr is !null: UnsafeUnpin,
PhantomData<MathOp>: UnsafeUnpin,
PhantomData<ArgPart>: UnsafeUnpin,
PhantomData<(String, Arg)>: UnsafeUnpin,
PhantomData<IoBinding>: UnsafeUnpin,
*const StepKind is !null: UnsafeUnpin,
PhantomData<StepKind>: UnsafeUnpin,
PhantomData<(Box<Expr>, Vec<Step>)>: UnsafeUnpin,
PhantomData<(Vec<Expr>, Vec<Step>)>: UnsafeUnpin,
PhantomData<Arg>: UnsafeUnpin,
PhantomData<(String, String, bool)>: UnsafeUnpin,
impl UnwindSafe for StepKindwhere
RawVecInner: UnwindSafe,
&'static TypeDescriptor: UnwindSafe,
*mut (): UnwindSafe,
BoxRaw<GuardExpr>: UnwindSafe,
BoxRaw<Expr>: UnwindSafe,
BoxRaw<StepKind>: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.