[][src]Struct stdbench::config::Config

pub struct Config {
    pub workdir: PathBuf,
    pub source: Box<dyn PisaSource>,
    pub collections: Vec<Rc<Collection>>,
    pub runs: Vec<Run>,
    // some fields omitted
}

Stores a full config for benchmark run.

Fields

workdir: PathBuf

This is the default directory of the experiment. Any paths that are not absolute will be rooted at this directory.

source: Box<dyn PisaSource>

Configuration of where the tools come from.

collections: Vec<Rc<Collection>>

Configuration of all collections to be tested.

runs: Vec<Run>

Experimental runs

Methods

impl Config[src]

pub fn new<P>(workdir: P, source: Box<dyn PisaSource>) -> Self where
    P: AsRef<Path>, 
[src]

Constructs a new configuration with workdir and a source. It is recommended that workdir is an absolute path to avoid any misunderstandings.

pub fn executor(&self) -> Result<Box<dyn PisaExecutor>, Error>[src]

Example

In the following example, the code in the last line will clone the repository and build the source code (unless config suppresses this stage).

let source = GitSource::new(
    "https://github.com/pisa-engine/pisa.git",
    "master"
);
let config = Config::new(PathBuf::from("/workdir"), Box::new(source.clone()));
// Declare `config` as `mut` and execute the following line to skip
// the compilation stage:
// config.suppress_stage(Stage::Compile);
let executor = config.executor();

pub fn from_file<P>(file: P) -> Result<Self, Error> where
    P: AsRef<Path>, 
[src]

Load a config from a YAML file.

Example

match Config::from_file(PathBuf::from("config.yml")) {
    Ok(config) => {}
    Err(err) => {
        println!("Couldn't read config");
    }
}

pub fn suppress_stage(&mut self, stage: Stage)[src]

Adds a stage to be suppressed during experiment.

pub fn is_suppressed(&self, stage: Stage) -> bool[src]

Returns true if the given stage was suppressed in the config.

Trait Implementations

impl FromYaml for Config[src]

fn from_yaml_at_key(yaml: &Yaml, key: &str) -> Result<Self, Error>[src]

Parse a property value at a given key.

impl Debug for Config[src]

Auto Trait Implementations

impl !Sync for Config

impl !Send for Config

impl Unpin for Config

impl !UnwindSafe for Config

impl !RefUnwindSafe for Config

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Downcast for T where
    T: Any
[src]