[−][src]Struct stdbench::config::Config
Stores a full config for benchmark run.
Fields
workdir: PathBufThis 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]
P: AsRef<Path>,
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]
P: AsRef<Path>,
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(yaml: &Yaml) -> Result<Self, Error>[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]
U: From<T>,
impl<T> From<T> for T[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Downcast for T where
T: Any, [src]
T: Any,