pub struct EconomicsMeasureArgs {
pub repo: RepoArgs,
pub suite: String,
pub dry_run: bool,
}Expand description
majordomus economics measure. Runs a deterministic suite, the context compiler over
the suite’s seeds with no model called, and writes its record as
runs/<suite>/<commit>.json under the benchmark directory, so a second measurement at
the same commit replaces the first. A live suite is refused with the run command that
runs it; --dry-run measures, prints and writes nothing.
use clap::Parser;
use majordomus_cli::cli::{Cli, Command, EconomicsCommand, EconomicsMeasureArgs};
fn measure_of(argv: &[&str]) -> EconomicsMeasureArgs {
let cli = Cli::try_parse_from(argv.iter().copied()).unwrap();
let Command::Economics(args) = cli.command else { panic!("economics") };
let EconomicsCommand::Measure(measure) = args.command else { panic!("measure") };
measure
}
let default = measure_of(&["majordomus", "economics", "measure"]);
assert_eq!(default.suite, "context");
assert!(!default.dry_run, "measuring records unless told otherwise");
assert!(measure_of(&["majordomus", "economics", "measure", "--dry-run"]).dry_run);Fields§
§repo: RepoArgsWhere and how the repository is read.
suite: StringThe deterministic suite to measure
dry_run: boolMeasure and print, write nothing
Trait Implementations§
Source§impl Args for EconomicsMeasureArgs
impl Args for EconomicsMeasureArgs
Source§fn group_id() -> Option<Id>
fn group_id() -> Option<Id>
Report the [
ArgGroup::id][crate::ArgGroup::id] for this set of argumentsSource§fn augment_args<'b>(__clap_app: Command) -> Command
fn augment_args<'b>(__clap_app: Command) -> Command
Source§fn augment_args_for_update<'b>(__clap_app: Command) -> Command
fn augment_args_for_update<'b>(__clap_app: Command) -> Command
Append to [
Command] so it can instantiate self via
[FromArgMatches::update_from_arg_matches_mut] Read moreSource§impl Debug for EconomicsMeasureArgs
impl Debug for EconomicsMeasureArgs
Source§impl FromArgMatches for EconomicsMeasureArgs
impl FromArgMatches for EconomicsMeasureArgs
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
Assign values from
ArgMatches to self.Source§fn update_from_arg_matches_mut(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
Assign values from
ArgMatches to self.Auto Trait Implementations§
impl Freeze for EconomicsMeasureArgs
impl RefUnwindSafe for EconomicsMeasureArgs
impl Send for EconomicsMeasureArgs
impl Sync for EconomicsMeasureArgs
impl Unpin for EconomicsMeasureArgs
impl UnsafeUnpin for EconomicsMeasureArgs
impl UnwindSafe for EconomicsMeasureArgs
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