async_zip2/tokio/read/
mod.rs

1// Copyright (c) 2023 Harry [Majored] [hello@majored.pw]
2// MIT License (https://github.com/Majored/rs-async-zip/blob/main/LICENSE)
3
4//! A module which supports reading ZIP files.
5
6use tokio_util::compat::Compat;
7
8#[cfg(feature = "tokio-fs")]
9pub mod fs;
10#[cfg(doc)]
11use crate::base;
12#[cfg(doc)]
13use tokio;
14
15/// A [`tokio`]-specific type alias for [`base::read::ZipEntryReader`];
16pub type ZipEntryReader<'a, R, E> = crate::base::read::ZipEntryReader<'a, Compat<R>, E>;
17
18pub mod seek {
19    //! A ZIP reader which acts over a seekable source.
20    use tokio_util::compat::Compat;
21
22    #[cfg(doc)]
23    use crate::base;
24    #[cfg(doc)]
25    use tokio;
26
27    /// A [`tokio`]-specific type alias for [`base::read::seek::ZipFileReader`];
28    pub type ZipFileReader<R> = crate::base::read::seek::ZipFileReader<Compat<R>>;
29}
30
31pub mod stream {
32    //! A ZIP reader which acts over a non-seekable source.
33
34    #[cfg(doc)]
35    use crate::base;
36    #[cfg(doc)]
37    use tokio;
38    use tokio_util::compat::Compat;
39
40    /// A [`tokio`]-specific type alias for [`base::read::stream::Reading`];
41    pub type Reading<'a, R, E> = crate::base::read::stream::Reading<'a, Compat<R>, E>;
42    /// A [`tokio`]-specific type alias for [`base::read::stream::Ready`];
43    pub type Ready<R> = crate::base::read::stream::Ready<Compat<R>>;
44}