ctf_pwn/io/cache/
traits.rs

1use std::io;
2use std::pin::Pin;
3use std::task::{Context, Poll};
4pub use tokio::io::AsyncBufRead;
5use tokio::io::{AsyncRead, ReadBuf};
6
7pub trait AsyncCacheRead: AsyncRead {
8    fn poll_reader(
9        self: Pin<&mut Self>,
10        cx: &mut Context<'_>,
11        buf: &mut ReadBuf<'_>,
12    ) -> Poll<io::Result<()>>;
13
14    fn consume(self: Pin<&mut Self>, amt: usize);
15    fn restore(self: Pin<&mut Self>, data: &[u8]);
16}