use std::path::PathBuf;
use super::format::ExportFormat;
#[derive(Debug, Clone)]
pub struct ExportResult {
pub path: PathBuf,
pub format: ExportFormat,
pub size_bytes: u64,
pub num_tensors: usize,
}
impl ExportResult {
#[must_use]
pub fn size_human(&self) -> String {
if self.size_bytes >= 1_000_000_000 {
format!("{:.2} GB", self.size_bytes as f64 / 1e9)
} else if self.size_bytes >= 1_000_000 {
format!("{:.2} MB", self.size_bytes as f64 / 1e6)
} else if self.size_bytes >= 1_000 {
format!("{:.2} KB", self.size_bytes as f64 / 1e3)
} else {
format!("{} B", self.size_bytes)
}
}
}