aboutsummaryrefslogtreecommitdiff
path: root/src/zip/file.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/zip/file.rs')
-rw-r--r--src/zip/file.rs44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/zip/file.rs b/src/zip/file.rs
new file mode 100644
index 0000000..dba8d06
--- /dev/null
+++ b/src/zip/file.rs
@@ -0,0 +1,44 @@
1use crate::file::{ArchiveFile, ArchiveFileRead, ArchiveFileWrite};
2use std::io::{Read, Write};
3
4pub struct FileInfo {}
5
6pub struct FileReader {}
7
8pub struct FileWriter {}
9
10impl ArchiveFile for FileReader {
11 type Info = FileInfo;
12
13 fn info() -> Self::Info {
14 Self::Info {}
15 }
16}
17
18impl Read for FileReader {
19 fn read(&mut self, buf: &mut [u8]) -> std::io::Result<usize> {
20 return Ok(0);
21 }
22}
23
24impl ArchiveFileRead for FileReader {}
25
26impl ArchiveFile for FileWriter {
27 type Info = FileInfo;
28
29 fn info() -> Self::Info {
30 Self::Info {}
31 }
32}
33
34impl Write for FileWriter {
35 fn write(&mut self, buf: &[u8]) -> std::io::Result<usize> {
36 return Ok(0);
37 }
38
39 fn flush(&mut self) -> std::io::Result<()> {
40 Ok(())
41 }
42}
43
44impl ArchiveFileWrite for FileWriter {}