ctf_pwn/io/cache/
mod.rs

1mod read;
2mod traits;
3
4pub use traits::*;
5
6use pin_project_lite::pin_project;
7
8pin_project! {
9    /// An `AsyncRead`er which applies a timeout to read operations.
10    #[derive(Debug)]
11    pub struct CacheReader<R> {
12        #[pin]
13        pub(crate) reader: R,
14        #[pin]
15        pub(crate) cache: Vec<u8>
16    }
17}
18
19impl<R> CacheReader<R> {
20    pub fn new(reader: R) -> CacheReader<R> {
21        CacheReader {
22            reader,
23            cache: Vec::new(),
24        }
25    }
26}