aboutsummaryrefslogtreecommitdiff
path: root/src/driver/driver.rs
blob: 3a8ed16b90264771cbb78ed4ccdc5aaeafcdd62c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
use crate::driver::ArchiveFile;
use crate::ArchiveResult;
use std::error::Error;
use std::io::{Read, Write};

pub trait Driver: Sized {
    type Error: Error;

    type IO;
    type File: ArchiveFile;
}

pub trait ArchiveRead: Driver
where
    Self::IO: Read,
{
    // Create driver instance
    fn read(io: Self::IO) -> ArchiveResult<Self, Self::Error>;
}

pub trait ArchiveWrite: ArchiveRead
where
    Self::IO: Read + Write,
{
}