pub struct ListOptions {
pub recursive: bool,
pub follow_symlinks: bool,
pub include_files: bool,
pub include_directories: bool,
pub include_symlinks: bool,
pub include_hidden: bool,
pub include_other: bool,
pub max_depth: Option<usize>,
pub max_entries: Option<usize>,
pub sort: SortMode,
pub error_policy: TraversalErrorPolicy,
pub include_root: bool,
}listing only.Expand description
Options controlling directory listing and traversal.
§Defaults
- Non-recursive (immediate children only)
- Do not follow symlinks
- Include files and directories
- Include symlinks as entries (not followed)
- Exclude hidden entries
- Fail-fast on errors
- Sort by path
See module docs for the unified depth model shared with discovery.
Fields§
§recursive: boolRecurse into subdirectories.
follow_symlinks: boolFollow symbolic links (cycle detection is best-effort via walkdir).
include_files: boolInclude regular files.
include_directories: boolInclude directories.
include_symlinks: boolInclude symlink entries (when not followed into).
Include hidden entries (dotfiles; Windows hidden attribute when available).
include_other: boolInclude other entry types (sockets, devices, etc.).
max_depth: Option<usize>Maximum walk depth when recursive is true (None = unlimited).
Depth 0 is the root; depth 1 is immediate children. See module docs.
Ignored when recursive is false (only depth-1 children are listed).
max_entries: Option<usize>Maximum number of returned entries.
sort: SortModeResult sort mode (list only; walk always yields in walk order).
error_policy: TraversalErrorPolicyError handling policy.
include_root: boolWhen true, include the root directory itself as an entry.
Implementations§
Source§impl ListOptions
impl ListOptions
Sourcepub fn follow_symlinks(self, follow: bool) -> Self
pub fn follow_symlinks(self, follow: bool) -> Self
Follow symlinks when walking.
Sourcepub fn include_files(self, include: bool) -> Self
pub fn include_files(self, include: bool) -> Self
Include regular files.
Sourcepub fn include_directories(self, include: bool) -> Self
pub fn include_directories(self, include: bool) -> Self
Include directories.
Sourcepub fn include_symlinks(self, include: bool) -> Self
pub fn include_symlinks(self, include: bool) -> Self
Include symlink entries.
Sourcepub fn include_other(self, include: bool) -> Self
pub fn include_other(self, include: bool) -> Self
Include other entry types.
Include hidden files and directories.
Sourcepub fn max_depth(self, depth: Option<usize>) -> Self
pub fn max_depth(self, depth: Option<usize>) -> Self
Set maximum depth (see module depth model).
Sourcepub fn max_entries(self, max: Option<usize>) -> Self
pub fn max_entries(self, max: Option<usize>) -> Self
Set maximum number of entries.
Sourcepub fn error_policy(self, policy: TraversalErrorPolicy) -> Self
pub fn error_policy(self, policy: TraversalErrorPolicy) -> Self
Set error policy.
Sourcepub fn include_root(self, include: bool) -> Self
pub fn include_root(self, include: bool) -> Self
Include the root directory itself.
Trait Implementations§
Source§impl Clone for ListOptions
impl Clone for ListOptions
Source§fn clone(&self) -> ListOptions
fn clone(&self) -> ListOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more