src/backup/archive_index.rs: first try
This commit is contained in:
@ -8,6 +8,7 @@ use std::sync::{Mutex, Arc};
|
||||
use crate::config::datastore;
|
||||
use super::chunk_store::*;
|
||||
use super::image_index::*;
|
||||
use super::archive_index::*;
|
||||
|
||||
pub struct DataStore {
|
||||
chunk_store: ChunkStore,
|
||||
@ -76,6 +77,16 @@ impl DataStore {
|
||||
Ok(index)
|
||||
}
|
||||
|
||||
pub fn create_archive_writer<P: AsRef<Path>>(
|
||||
&self, filename: P,
|
||||
chunk_size: usize
|
||||
) -> Result<ArchiveIndexWriter, Error> {
|
||||
|
||||
let index = ArchiveIndexWriter::create(&self.chunk_store, filename.as_ref(), chunk_size)?;
|
||||
|
||||
Ok(index)
|
||||
}
|
||||
|
||||
pub fn list_images(&self) -> Result<Vec<PathBuf>, Error> {
|
||||
let base = self.chunk_store.base_path();
|
||||
|
||||
|
Reference in New Issue
Block a user