use serde::Serialize;
#[derive(Debug, Serialize)]
pub struct FsckResult {
pub errors: Vec<FsckIssue>,
pub warnings: Vec<FsckIssue>,
pub stats: FsckStats,
pub repairable: bool,
pub orphaned_entries: Vec<OrphanedEntry>,
}
impl FsckResult {
pub fn is_clean(&self) -> bool {
self.errors.is_empty()
}
}
#[derive(Debug, Serialize)]
pub struct FsckIssue {
pub code: String,
pub message: String,
pub repairable: bool,
pub debug: bool,
}
#[derive(Debug, Serialize)]
pub struct FsckStats {
pub files_checked: u32,
pub directories_checked: u32,
pub extra: Vec<(String, String)>,
}
#[derive(Debug, Serialize)]
pub struct OrphanedEntry {
pub id: u64,
pub name: String,
pub is_directory: bool,
pub missing_parent_id: u64,
}
#[derive(Debug, Serialize)]
pub struct RepairReport {
pub fixes_applied: Vec<String>,
pub fixes_failed: Vec<String>,
pub unrepairable_count: usize,
}