pub struct WalkOptions {
pub follow_links: bool,
pub max_depth: usize,
pub ignore_errors: bool,
}Expand description
Configuration structure to customize the behavior of the walker, including depth limits and error handling policies. Configuration structure to customize the behavior of the directory walker.
This struct allows the user to define how the walker should handle symbolic links, how deep the recursion should go, and whether it should halt on errors.
Fields§
§follow_links: boolSpecifies whether the walker should follow symbolic links to directories.
If set to true, the walker will recurse into linked directories.
max_depth: usizeThe maximum number of directory levels to descend. A depth of 0 only visits the root path.
ignore_errors: boolIf set to true, I/O errors and symbolic link loops encountered
during iteration will be silently skipped.
Trait Implementations§
Source§impl Clone for WalkOptions
impl Clone for WalkOptions
Source§fn clone(&self) -> WalkOptions
fn clone(&self) -> WalkOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WalkOptions
impl Debug for WalkOptions
Source§impl Default for WalkOptions
impl Default for WalkOptions
Source§fn default() -> Self
fn default() -> Self
Provides the default configuration for directory traversal.
§Returns
Returns a WalkOptions instance with the following defaults:
follow_links:false- Does not follow symbolic links to prevent accidental loops.max_depth:512- A conservative limit to prevent stack exhaustion in extremely deep trees.ignore_errors:false- All errors are reported to the user by default for maximum safety.