Skip to main content

Module walk

Module walk 

Source
Expand description

Directory traversal with filtering for tree hashing, archive packing, and mtime computation.

Substrate defines the traversal logic and filtering rules; callers provide I/O via the DirReader trait. This keeps substrate zero-I/O and WASM-compatible while ensuring consistent filtering everywhere.

Structs§

DirEntry
A single entry returned by DirReader::read_dir.

Traits§

DirReader
Filesystem abstraction so substrate can drive traversal without doing I/O itself.

Functions§

flatten_entries
Flatten a recursive TreeEntry tree into a flat list of (path, content, executable).
max_mtime
Walk a directory and return the maximum file modification time (epoch ms).
should_exclude
Check whether a filename should be excluded (exact name match).
walk_dir
Walk a directory tree and produce TreeEntry values.