[][src]Struct stdbench::run::Run

pub struct Run {
    pub collection: Rc<Collection>,
    pub data: RunData,
}

An experimental run

Fields

collection: Rc<Collection>

Pointer to evalated collection

data: RunData

Data specific to type of run

Methods

impl Run[src]

pub fn parse<P>(
    yaml: &Yaml,
    collections: &CollectionMap,
    workdir: P
) -> Result<Self, Error> where
    P: AsRef<Path>, 
[src]

Constructs from a YAML object, given a collection map.

Fails if failed to parse, or when the referenced collection is missing form the mapping.

Example

let yaml = yaml_rust::YamlLoader::load_from_str("
collection: wapo
type: evaluate
topics: /path/to/query/topics
qrels: /path/to/query/relevance
output: /output").unwrap();

let mut collections: CollectionMap = HashMap::new();
let run = Run::parse(&yaml[0], &collections, PathBuf::from("work"));
assert!(run.is_err());

collections.insert(String::from("wapo"), Rc::new(Collection {
    name: "wapo".to_string(),
    kind: WashingtonPostCollection::boxed(),
    collection_dir: PathBuf::from("/coll/dir"),
    forward_index: PathBuf::from("fwd"),
    inverted_index: PathBuf::from("inv"),
    encodings: vec![Encoding::from("block_simdbp")]
}));
let run = Run::parse(&yaml[0], &collections, PathBuf::from("work")).unwrap();
assert_eq!(run.collection.name, "wapo");

pub fn run_type(&self) -> String[src]

Returns the type of this run.

Example

let collection = Rc::new(Collection {
    name: "wapo".to_string(),
    kind: WashingtonPostCollection::boxed(),
    collection_dir: PathBuf::from("/coll/dir"),
    forward_index: PathBuf::from("fwd"),
    inverted_index: PathBuf::from("inv"),
    encodings: vec![Encoding::from("block_simdbp")]
});
assert_eq!(
    Run {
        collection: Rc::clone(&collection),
        data: RunData::Evaluate(EvaluateData {
            topics: PathBuf::new(),
            topics_format: TopicsFormat::Simple,
            qrels: PathBuf::new(),
            output_file: PathBuf::from("output")
        })
    }.run_type(),
    "evaluate"
);
assert_eq!(
    Run {
        collection,
        data: RunData::Benchmark
    }.run_type(),
    "benchmark"
);

Trait Implementations

impl Clone for Run[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for Run[src]

Auto Trait Implementations

impl !Sync for Run

impl !Send for Run

impl Unpin for Run

impl !UnwindSafe for Run

impl !RefUnwindSafe for Run

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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]