use std::path::PathBuf;
use std::time::SystemTime;
#[derive(Debug, Clone, PartialEq, Eq, Default)]
pub struct Entry {
pub path: PathBuf,
pub relative_path: PathBuf,
pub size: u64,
pub modified: Option<SystemTime>,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct DirEntry {
pub path: PathBuf,
pub relative_path: PathBuf,
pub mode: Option<u32>,
}
#[derive(Debug, Clone, Default)]
pub struct Workload {
pub small: Vec<Entry>,
pub large: Vec<Entry>,
pub directories: Vec<DirEntry>,
}
impl Workload {
pub(crate) fn partition(entries: Vec<Entry>, threshold: u64) -> Self {
let (small, large) = entries.into_iter().partition(|e| e.size <= threshold);
Self { small, large, directories: Vec::new() }
}
}