src/pxar/sequential_decoder.rs: remove callback from new()

And use an extra functzion  set_callback() to configure that.

Also rewrite pxar/fuse.rs and implement a generic Session (will get
further cleanups with next patches).
This commit is contained in:
Dietmar Maurer
2019-11-26 09:56:48 +01:00
parent 49fddd985c
commit f701d0335e
7 changed files with 305 additions and 300 deletions

View File

@ -21,7 +21,7 @@ pub struct Shell {
/// List of paths selected for a restore
selected: HashSet<Vec<u8>>,
/// Decoder instance for the current pxar archive
decoder: Decoder<BufferedDynamicReader<RemoteChunkReader>, fn(&Path) -> Result<(), Error>>,
decoder: Decoder<BufferedDynamicReader<RemoteChunkReader>>,
/// Root directory for the give archive as stored in the catalog
root: Vec<DirEntry>,
}
@ -60,7 +60,7 @@ impl Shell {
pub fn new(
mut catalog: CatalogReader<std::fs::File>,
archive_name: &str,
decoder: Decoder<BufferedDynamicReader<RemoteChunkReader>, fn(&Path) -> Result<(), Error>>
decoder: Decoder<BufferedDynamicReader<RemoteChunkReader>>
) -> Result<Self, Error> {
let catalog_root = catalog.root()?;
// The root for the given archive as stored in the catalog