[−][src]Struct stdbench::run::Run
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]
yaml: &Yaml,
collections: &CollectionMap,
workdir: P
) -> Result<Self, Error> where
P: AsRef<Path>,
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(&self) -> 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]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
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,