File tree Expand file tree Collapse file tree 2 files changed +15
-13
lines changed
mithril-client-cli/src/utils/archive_unpacker Expand file tree Collapse file tree 2 files changed +15
-13
lines changed Original file line number Diff line number Diff line change
1
+ use std:: path:: Path ;
2
+
3
+ use mithril_client:: MithrilResult ;
4
+
5
+ /// Trait for supported archive formats (e.g. `.zip`, `.tar.gz`).
6
+ #[ cfg_attr( test, mockall:: automock) ]
7
+ pub trait ArchiveFormat {
8
+ /// Checks whether this format can handle the given archive file.
9
+ fn supports ( & self , archive_path : & Path ) -> bool ;
10
+
11
+ /// Unpacks the archive into the target directory.
12
+ fn unpack ( & self , archive_path : & Path , unpack_dir : & Path ) -> MithrilResult < ( ) > ;
13
+ }
Original file line number Diff line number Diff line change
1
+ mod interface;
1
2
mod tar_gz_unpacker;
2
3
mod unpacker;
3
4
mod zip_unpacker;
4
5
6
+ pub use interface:: * ;
5
7
pub use unpacker:: * ;
6
-
7
- use mithril_client:: MithrilResult ;
8
- use std:: path:: Path ;
9
-
10
- /// Trait for supported archive formats (e.g. `.zip`, `.tar.gz`).
11
- #[ cfg_attr( test, mockall:: automock) ]
12
- pub trait ArchiveFormat {
13
- /// Checks whether this format can handle the given archive file.
14
- fn supports ( & self , archive_path : & Path ) -> bool ;
15
-
16
- /// Unpacks the archive into the target directory.
17
- fn unpack ( & self , archive_path : & Path , unpack_dir : & Path ) -> MithrilResult < ( ) > ;
18
- }
You can’t perform that action at this time.
0 commit comments