pub struct RunnerOptions {
pub other: Vec<String>,
pub define: BTreeMap<String, String>,
}Expand description
Runtime variable definitions and additional arguments for a Runner.
Default creates an empty definition map and argument list. The map holds
at most one value per name and is forwarded in key order, not insertion
order. Values are stored without validating the selected runtime’s naming
or value rules.
§Examples
use asimov_patterns::RunnerOptions;
let options = RunnerOptions::builder()
.define("mode", "preview")
.define("expression", "a=b")
.build();
assert_eq!(options.define.get("expression").map(String::as_str), Some("a=b"));Fields§
§other: Vec<String>Additional arguments appended after definitions, including an optional program file.
Each string is one literal argument, without shell expansion. To express
ordered or repeated --define arguments that the map cannot represent,
put them here and leave those keys out of define.
The program’s documented duplicate-definition policy then applies.
See crate::programs for option and operand ordering.
define: BTreeMap<String, String>Named runtime values passed as --define=VAR=VAL (-D in the CLI).
The runner emits one argument per entry in BTreeMap key order. The
program splits the argument value at its first =: names must be
nonempty and cannot contain =, while values may be empty or contain
additional = characters. These constraints are not checked here.
Replacing a key in this map replaces its previous value before execution; it does not send duplicate definitions to the program. Definitions are runtime arguments, not environment-variable assignments or shell source.
Implementations§
Source§impl RunnerOptions
impl RunnerOptions
Sourcepub fn builder() -> RunnerOptionsBuilder
pub fn builder() -> RunnerOptionsBuilder
Create an instance of RunnerOptions using the builder syntax