Skip to main content

walk_module_tree

Function walk_module_tree 

Source
pub fn walk_module_tree<E>(
    root: &Path,
    visitor: &mut dyn FnMut(&Path, u64) -> Result<(), E>,
) -> Result<TreeStats, WalkError<E>>
Expand description

Walks every regular file under root, enforcing containment and metadata exclusion. Calls visitor for each file with its path and size. Returns aggregate statistics.

The walk enforces these rules.

  • Entries named .git or .sprocket are skipped.
  • Any symbolic link is rejected with ModuleWalkError::Symlink.
  • Only regular files are visited.