1#[cfg(feature = "file")]
2pub mod file;
3
4use std::future::Future;
5
6use crate::ProgressEntry;
7use bytes::Bytes;
8
9pub trait SeqWriter: Send {
10 fn write_sequentially(
11 &mut self,
12 bytes: &Bytes,
13 ) -> impl Future<Output = Result<(), std::io::Error>> + Send;
14 fn flush(&mut self) -> impl Future<Output = Result<(), std::io::Error>> + Send;
15}
16
17pub trait RandWriter: Send {
18 fn write_randomly(
19 &mut self,
20 range: ProgressEntry,
21 bytes: &Bytes,
22 ) -> impl Future<Output = Result<(), std::io::Error>> + Send;
23 fn flush(&mut self) -> impl Future<Output = Result<(), std::io::Error>> + Send;
24}