use async_trait::async_trait;
use lance_table::format::Fragment;
use crate::Result;
#[async_trait]
pub trait WriteFragmentProgress: std::fmt::Debug + Sync + Send {
async fn begin(&self, fragment: &Fragment) -> Result<()>;
async fn complete(&self, fragment: &Fragment) -> Result<()>;
}
#[derive(Debug, Clone, Default)]
pub struct NoopFragmentWriteProgress {}
impl NoopFragmentWriteProgress {
pub fn new() -> Self {
Self {}
}
}
#[async_trait]
impl WriteFragmentProgress for NoopFragmentWriteProgress {
#[inline]
async fn begin(&self, _fragment: &Fragment) -> Result<()> {
Ok(())
}
#[inline]
async fn complete(&self, _fragment: &Fragment) -> Result<()> {
Ok(())
}
}