use super::*; use std::collections::HashMap; use std::path::PathBuf; /// Contains a graph of all paths and inodes that were successfully stat'd #[derive(Debug, Clone, PartialEq, Eq)] pub struct INodeInfoGraph { inodes: HashMap, // FsInfo contains parent INode that can be used to look up again in this table paths: HashMap, // map absolute paths to INodes to be looked up in `inodes` table. } impl INodeInfoGraph { /// Create a new graph from these linked `HashMap`s #[inline] pub fn new(inodes: HashMap, paths: HashMap) -> Self { Self { inodes, paths } } //TODO: Get whole directory structure. Find largest, etc. //TODO: Order by largest file size, get, iter, etc //TODO: Group children to parent (child FSInfos all have references to their parent INode, but parents don't have references to their children. Top level FsInfos will also have parent INodes that don't appear in the map as keys.) }