backup-client: allow to specify directories (prepare for catar backup)
This commit is contained in:
@ -62,9 +62,9 @@ impl DataStore {
|
||||
})
|
||||
}
|
||||
|
||||
pub fn create_image_writer<P: AsRef<Path>>(&mut self, filename: P, size: usize, chunk_size: usize) -> Result<ImageIndexWriter, Error> {
|
||||
pub fn create_image_writer<P: AsRef<Path>>(&self, filename: P, size: usize, chunk_size: usize) -> Result<ImageIndexWriter, Error> {
|
||||
|
||||
let index = ImageIndexWriter::create(&mut self.chunk_store, filename.as_ref(), size, chunk_size)?;
|
||||
let index = ImageIndexWriter::create(&self.chunk_store, filename.as_ref(), size, chunk_size)?;
|
||||
|
||||
Ok(index)
|
||||
}
|
||||
|
@ -131,7 +131,7 @@ impl <'a> ImageIndexReader<'a> {
|
||||
}
|
||||
|
||||
pub struct ImageIndexWriter<'a> {
|
||||
store: &'a mut ChunkStore,
|
||||
store: &'a ChunkStore,
|
||||
filename: PathBuf,
|
||||
tmp_filename: PathBuf,
|
||||
chunk_size: usize,
|
||||
@ -153,7 +153,7 @@ impl <'a> Drop for ImageIndexWriter<'a> {
|
||||
|
||||
impl <'a> ImageIndexWriter<'a> {
|
||||
|
||||
pub fn create(store: &'a mut ChunkStore, path: &Path, size: usize, chunk_size: usize) -> Result<Self, Error> {
|
||||
pub fn create(store: &'a ChunkStore, path: &Path, size: usize, chunk_size: usize) -> Result<Self, Error> {
|
||||
|
||||
let full_path = store.relative_path(path);
|
||||
let mut tmp_path = full_path.clone();
|
||||
|
Reference in New Issue
Block a user