1use crate::ProgressEntry;
2use core::future;
3
4pub trait RandPusher: Send {
5 type Error: Send;
6 fn push(
7 &mut self,
8 range: ProgressEntry,
9 content: &[u8],
10 ) -> impl Future<Output = Result<(), Self::Error>> + Send;
11 fn flush(&mut self) -> impl Future<Output = Result<(), Self::Error>> + Send {
12 future::ready(Ok(()))
13 }
14}
15
16pub trait SeqPusher: Send {
17 type Error: Send;
18 fn push(&mut self, content: &[u8]) -> impl Future<Output = Result<(), Self::Error>> + Send;
19 fn flush(&mut self) -> impl Future<Output = Result<(), Self::Error>> + Send {
20 future::ready(Ok(()))
21 }
22}