summaryrefslogtreecommitdiff
path: root/src/data.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/data.rs')
-rw-r--r--src/data.rs13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/data.rs b/src/data.rs
index aaaebc9..04376bc 100644
--- a/src/data.rs
+++ b/src/data.rs
@@ -1,4 +1,5 @@
use crate::specification::{Create, FileCount};
+use std::path::{Path, PathBuf};
/// Test data management for Obnam benchmarks.
///
@@ -6,7 +7,9 @@ use crate::specification::{Create, FileCount};
/// that backup. That data is later cleaned up. Is all handled by this
/// structure.
#[derive(Debug)]
-pub struct Data {}
+pub struct Data {
+ tempdir: PathBuf,
+}
/// Possible errors from managing data.
#[derive(Debug, thiserror::Error)]
@@ -14,12 +17,14 @@ pub enum DataError {
}
impl Data {
- pub(crate) fn new() -> Result<Self, DataError> {
- Ok(Self {})
+ pub(crate) fn new(tempdir: &Path) -> Result<Self, DataError> {
+ Ok(Self {
+ tempdir: tempdir.to_path_buf(),
+ })
}
pub(crate) fn create(&self, create: &Create) -> Result<(), DataError> {
- println!("create {:?}", create);
+ println!("create {:?} in {}", create, self.tempdir.display());
Ok(())
}