fast_pull/base/
pusher.rs

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