diff options
| author | Igor Tolmachov <me@igorek.dev> | 2023-08-29 20:24:44 +0900 |
|---|---|---|
| committer | Igor Tolmachev <me@igorek.dev> | 2024-06-23 15:34:33 +0900 |
| commit | f02a44964a2fdb91d62dee9c55f6d03648f985cb (patch) | |
| tree | 4e1e91ab8cc19a9a9f2dfdd03c0ecbc2b6da2a14 /src/archive.rs | |
| parent | d8be93a740e8cc8103c4f9e260a62244eba1a6a4 (diff) | |
| download | archivator-f02a44964a2fdb91d62dee9c55f6d03648f985cb.tar.gz archivator-f02a44964a2fdb91d62dee9c55f6d03648f985cb.zip | |
Add zip stubs
Diffstat (limited to 'src/archive.rs')
| -rw-r--r-- | src/archive.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/archive.rs b/src/archive.rs index a1fe344..3c2106a 100644 --- a/src/archive.rs +++ b/src/archive.rs | |||
| @@ -1,14 +1,14 @@ | |||
| 1 | use crate::result::ArchiveResult; | ||
| 2 | use std::{fs::File, path::Path}; | ||
| 3 | |||
| 4 | use crate::io::{ArchiveRead, ArchiveWrite}; | 1 | use crate::io::{ArchiveRead, ArchiveWrite}; |
| 2 | use crate::result::ArchiveResult; | ||
| 3 | use std::fs::File; | ||
| 4 | use std::path::Path; | ||
| 5 | 5 | ||
| 6 | pub struct Archive<IO> { | 6 | pub struct Archive<IO> { |
| 7 | io: IO, | 7 | io: IO, |
| 8 | } | 8 | } |
| 9 | 9 | ||
| 10 | impl<IO: ArchiveRead> Archive<IO> { | 10 | impl<IO: ArchiveRead> Archive<IO> { |
| 11 | pub fn open(path: impl AsRef<Path>) -> ArchiveResult<Self> | 11 | pub fn file_reader(path: impl AsRef<Path>) -> ArchiveResult<Self> |
| 12 | where | 12 | where |
| 13 | IO: ArchiveRead<Reader = File>, | 13 | IO: ArchiveRead<Reader = File>, |
| 14 | { | 14 | { |
| @@ -23,7 +23,7 @@ impl<IO: ArchiveRead> Archive<IO> { | |||
| 23 | } | 23 | } |
| 24 | 24 | ||
| 25 | impl<IO: ArchiveWrite> Archive<IO> { | 25 | impl<IO: ArchiveWrite> Archive<IO> { |
| 26 | pub fn create(path: impl AsRef<Path>) -> ArchiveResult<Self> | 26 | pub fn file_writer(path: impl AsRef<Path>) -> ArchiveResult<Self> |
| 27 | where | 27 | where |
| 28 | IO: ArchiveWrite<Writer = File>, | 28 | IO: ArchiveWrite<Writer = File>, |
| 29 | { | 29 | { |
