1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//! Output of [`crate::Swdir::walk`] — the tree *and* any errors encountered.
//!
//! 0.9's `walk()` returned just [`crate::DirNode`] and printed I/O failures
//! to stderr. 0.10 returns this explicit report so callers can decide
//! programmatically how to handle partial failures.
use crateDirNode;
use crateWalkError;
/// Result of a [`crate::Swdir::walk`] call.
///
/// `tree` always represents the successfully-scanned portion of the
/// directory tree (on-error dirs appear in it with empty `files`/`sub_dirs`
/// — the walk does not unwind). `errors` lists every I/O problem hit
/// along the way, in no particular order.
///
/// For most callers, the two-step `let report = ...; let tree = report.tree;`
/// pattern is noise-free; when you care, match on `report.errors.is_empty()`.