Skip to main content

DatasetLoader

Trait DatasetLoader 

Source
pub trait DatasetLoader {
    // Required methods
    fn name(&self) -> &'static str;
    fn load(&self, path: &Path) -> Result<Vec<Scenario>, BenchError>;
}
Expand description

Loads scenarios from a dataset file on disk.

Implement this trait to add support for a new dataset format. The harness calls DatasetLoader::load once per run to materialise the full scenario list before iterating.

Built-in implementations:

Required Methods§

Source

fn name(&self) -> &'static str

Short identifier matching the dataset name in crate::DatasetRegistry.

Source

fn load(&self, path: &Path) -> Result<Vec<Scenario>, BenchError>

Load all matching scenarios from path.

§Errors

Returns BenchError::Io when the file cannot be opened or read, and BenchError::InvalidFormat when the file content cannot be parsed.

Implementors§