use std::future::Future;
use std::pin::Pin;
use bytes::Bytes;
use xet_client::cas_types::FileRange;
use xet_runtime::utils::adjustable_semaphore::AdjustableSemaphorePermit;
use super::super::Result;
pub type DataFuture = Pin<Box<dyn Future<Output = Result<Bytes>> + Send + 'static>>;
#[async_trait::async_trait]
pub trait DataWriter: Send + 'static {
async fn set_next_term_data_source(
&mut self,
byte_range: FileRange,
permit: Option<AdjustableSemaphorePermit>,
data_future: DataFuture,
) -> Result<()>;
async fn finish(mut self: Box<Self>) -> Result<u64>;
}