pub trait Step:
'static
+ Clone
+ Debug
+ PartialEq
+ Eq
+ Hash {
type Output: Clone;
const DEFAULT: bool = false;
const ONLY_HOSTS: bool = false;
// Required methods
fn run(self, builder: &Builder<'_>) -> Self::Output;
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_>;
// Provided method
fn make_run(_run: RunConfig<'_>) { ... }
}
Required Associated Types§
Provided Associated Constants§
sourceconst DEFAULT: bool = false
const DEFAULT: bool = false
Whether this step is run by default as part of its respective phase.
true
here can still be overwritten by should_run
calling default_condition
.
sourceconst ONLY_HOSTS: bool = false
const ONLY_HOSTS: bool = false
If true, then this rule should be skipped if –target was specified, but –host was not
Required Methods§
sourcefn run(self, builder: &Builder<'_>) -> Self::Output
fn run(self, builder: &Builder<'_>) -> Self::Output
Primary function to execute this rule. Can call builder.ensure()
with other steps to run those.
This gets called twice during a normal ./x.py
execution: first
with dry_run() == true
, and then for real.
sourcefn should_run(run: ShouldRun<'_>) -> ShouldRun<'_>
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_>
When bootstrap is passed a set of paths, this controls whether this rule
will execute. However, it does not get called in a “default” context
when we are not passed any paths; in that case, make_run
is called
directly.
Provided Methods§
sourcefn make_run(_run: RunConfig<'_>)
fn make_run(_run: RunConfig<'_>)
Builds up a “root” rule, either as a default rule or from a path passed to us.
When path is None
, we are executing in a context where no paths were
passed. When ./x.py build
is run, for example, this rule could get
called if it is in the correct list below with a path of None
.