pub struct Invocation {
pub program: PathBuf,
pub args: Vec<Arg>,
pub env: Vec<(String, Arg)>,
pub cwd: Option<PathBuf>,
pub stage: Vec<Stage>,
pub needs: Vec<PathBuf>,
pub host_env: Vec<HostEnv>,
pub tools: Vec<ToolRef>,
pub resources: Vec<(String, u64)>,
pub runs: Option<String>,
pub threads: Threads,
pub prechecks: Vec<Precheck>,
}Expand description
The tool-specific half of a step: one program and its arguments, run without a shell.
Fields§
§program: PathBuf§args: Vec<Arg>§env: Vec<(String, Arg)>§cwd: Option<PathBuf>Working directory. Defaults to the step’s directory.
stage: Vec<Stage>§needs: Vec<PathBuf>Programs the command runs itself, by name, such as the compiler a
Makefile calls. Prechecked on PATH like program.
host_env: Vec<HostEnv>Variables set from the host when the process starts. Not keyed.
tools: Vec<ToolRef>The tools this invocation uses. The version each reports and the host variables it names are part of the cache key, so a new tool version is a miss.
resources: Vec<(String, u64)>What the process holds from the scheduler’s resource pools while it
runs, other than threads, such as one xcelium licence: the pool’s
name and how much. It only decides when the step starts, so it is
not keyed.
runs: Option<String>The tool resources are given and measured for, where it is not the
first of tools: a simulator running a model it built, which needs
no tool of its own to run. Not keyed.
threads: ThreadsThe CPU threads the process uses. One, unless the tool module or the flow’s config says otherwise. Not keyed either.
prechecks: Vec<Precheck>Conditions checked before any step of the run starts. Not keyed: they decide whether the step can run, not what it makes.
Implementations§
Source§impl Invocation
impl Invocation
pub fn new(program: impl Into<PathBuf>) -> Self
Sourcepub fn shell(script: &str) -> Self
pub fn shell(script: &str) -> Self
A command that needs a shell, such as a pipeline: bash -c SCRIPT.
That it does is plain in the step, where every other command is an
argument list. No flow has one yet.
Sourcepub fn precheck(self, check: Precheck) -> Self
pub fn precheck(self, check: Precheck) -> Self
Declare a condition checked before the run starts. See
Invocation::prechecks.
pub fn host_env(self, e: HostEnv) -> Self
Sourcepub fn resource(self, pool: &str, count: u64) -> Self
pub fn resource(self, pool: &str, count: u64) -> Self
Hold count of the pool pool while running. See
Invocation::resources.
Sourcepub fn threads(self, threads: Threads) -> Self
pub fn threads(self, threads: Threads) -> Self
Say how many threads the process uses. An Arg::Threads argument
tells the tool how many it was given.
Sourcepub fn tool_name(&self) -> Option<&str>
pub fn tool_name(&self) -> Option<&str>
The name of the tool the invocation runs: what runs says, or the
first it declares. Resources are given, and measured, for each tool.
Sourcepub fn runs(self, tool: &str) -> Self
pub fn runs(self, tool: &str) -> Self
Say which tool the invocation runs, for resources. See
Invocation::runs.
Sourcepub fn granted(&self, all: u64) -> u64
pub fn granted(&self, all: u64) -> u64
The threads the process is given, where all is as many as a step
can have.
Sourcepub fn tool(self, tool: impl Tool + 'static) -> Self
pub fn tool(self, tool: impl Tool + 'static) -> Self
Declare a tool the invocation uses. See Invocation::tools.
pub fn arg(self, a: impl Into<Arg>) -> Self
pub fn args<I, A>(self, args: I) -> Self
pub fn env(self, key: &str, value: impl Into<Arg>) -> Self
pub fn cwd(self, dir: impl Into<PathBuf>) -> Self
pub fn stage(self, s: Stage) -> Self
Sourcepub fn needs<I, P>(self, programs: I) -> Self
pub fn needs<I, P>(self, programs: I) -> Self
Declare programs the command runs itself. See Invocation::needs.
Sourcepub fn tool_dirs(&self) -> Vec<PathBuf>
pub fn tool_dirs(&self) -> Vec<PathBuf>
The directories settings give the invocation’s tools, which go in
front of PATH for it alone.
pub fn ports(&self) -> impl Iterator<Item = &str>
Trait Implementations§
Source§impl Clone for Invocation
impl Clone for Invocation
Source§fn clone(&self) -> Invocation
fn clone(&self) -> Invocation
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Invocation
impl Debug for Invocation
Auto Trait Implementations§
impl !RefUnwindSafe for Invocation
impl !UnwindSafe for Invocation
impl Freeze for Invocation
impl Send for Invocation
impl Sync for Invocation
impl Unpin for Invocation
impl UnsafeUnpin for Invocation
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more