use std::path::PathBuf;
use thiserror::Error;
pub mod sparse_vector;
pub mod spatial;
pub mod timeseries;
pub mod vector;
#[derive(Debug, Error)]
pub enum ReclaimError {
#[error("{operation} failed for '{}': {source}", path.display())]
Io {
operation: &'static str,
path: PathBuf,
#[source]
source: std::io::Error,
},
#[error("sparse-vector manifest at '{}' is unreadable: {detail}", path.display())]
SparseManifest { path: PathBuf, detail: String },
}
pub type Result<T> = std::result::Result<T, ReclaimError>;
#[derive(Debug, Default, Clone, Copy)]
pub struct ReclaimStats {
pub files_unlinked: u32,
pub bytes_freed: u64,
}
impl ReclaimStats {
pub fn merge(&mut self, other: ReclaimStats) {
self.files_unlinked = self.files_unlinked.saturating_add(other.files_unlinked);
self.bytes_freed = self.bytes_freed.saturating_add(other.bytes_freed);
}
}