Skip to main content

walk

Function walk 

Source
pub fn walk(
    root: impl AsRef<Path>,
    options: &ListOptions,
) -> Result<WalkIter, PathError>
Available on crate feature listing only.
Expand description

Stream filesystem entries under root in walk order.

Unlike list, this is a lazy iterator over the directory walk: entries are produced as the filesystem is traversed.

§Sorting

options.sort is ignored. Streaming cannot sort without buffering. Call list when deterministic ordering is required.

§Max entries

options.max_entries is enforced by stopping the iterator after that many yielded entries.

§Filesystem access

Yes. Requires root to exist.