aboutsummaryrefslogtreecommitdiff
path: root/src/archive.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/archive.rs')
-rw-r--r--src/archive.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/archive.rs b/src/archive.rs
new file mode 100644
index 0000000..a422f9e
--- /dev/null
+++ b/src/archive.rs
@@ -0,0 +1,20 @@
1use crate::driver::{ArchiveRead, ArchiveWrite, Driver};
2use crate::ArchiveResult;
3use std::io::{Read, Write};
4
5pub struct Archive<D: Driver> {
6 pub(crate) driver: D,
7}
8
9impl<D: ArchiveRead> Archive<D>
10where
11 D::IO: std::io::Read,
12{
13 pub fn new(io: D::IO) -> ArchiveResult<Self, D::Error> {
14 Ok(Self {
15 driver: D::read(io)?,
16 })
17 }
18}
19
20impl<D: ArchiveWrite> Archive<D> where D::IO: Read + Write {}