pub struct DiscoveryOptions {
pub recursive: bool,
pub follow_symlinks: bool,
pub max_depth: Option<usize>,
pub max_entries: Option<usize>,
pub skip_directory_names: Vec<String>,
pub skip_relative_prefixes: Vec<String>,
pub skip_globs: Vec<String>,
pub error_policy: TraversalErrorPolicy,
pub deduplicate: bool,
pub identity: PathIdentityOptions,
pub sort: SortMode,
}listing only.Expand description
Options for recursive directory discovery.
Skip rules are caller-configured. This crate does not hardcode
node_modules, .git, target, etc.
§Depth model
Same as crate::listing::ListOptions:
- Depth 0 — the walk root
- Depth 1 — immediate children
recursive: falselimits the walk to depth 0 only (the root)recursive: truewithmax_depth: Some(n)uses walkdirmax_depth = n
Fields§
§recursive: boolRecurse into subdirectories.
follow_symlinks: boolFollow symbolic links (best-effort cycle detection via walkdir).
max_depth: Option<usize>Maximum walk depth relative to the root (None = unlimited when recursive).
Depth 0 is the root itself; 1 is immediate children.
Ignored when recursive is false (only the root is considered).
max_entries: Option<usize>Maximum number of directories returned.
skip_directory_names: Vec<String>Directory names to skip (exact component match). Never applied to the root itself.
skip_relative_prefixes: Vec<String>Relative path prefixes (using / separators) to skip under the root.
skip_globs: Vec<String>search only.Glob patterns matched against relative paths (requires search / globset).
error_policy: TraversalErrorPolicyError handling policy.
deduplicate: boolDeduplicate results by identity key.
identity: PathIdentityOptionsIdentity options used when deduplicate is true.
sort: SortModeSort mode for the returned list.
Implementations§
Source§impl DiscoveryOptions
impl DiscoveryOptions
Sourcepub fn follow_symlinks(self, follow: bool) -> Self
pub fn follow_symlinks(self, follow: bool) -> Self
Follow symlinks when walking.
Sourcepub fn skip_names(
self,
names: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn skip_names( self, names: impl IntoIterator<Item = impl Into<String>>, ) -> Self
Skip exact directory names (e.g. "node_modules").
Sourcepub fn skip_relative_prefixes(
self,
prefixes: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn skip_relative_prefixes( self, prefixes: impl IntoIterator<Item = impl Into<String>>, ) -> Self
Skip relative path prefixes under the root.
Sourcepub fn max_depth(self, depth: Option<usize>) -> Self
pub fn max_depth(self, depth: Option<usize>) -> Self
Set maximum depth (see module / type docs).
Sourcepub fn max_entries(self, max: Option<usize>) -> Self
pub fn max_entries(self, max: Option<usize>) -> Self
Set maximum number of returned directories.
Sourcepub fn error_policy(self, policy: TraversalErrorPolicy) -> Self
pub fn error_policy(self, policy: TraversalErrorPolicy) -> Self
Set error policy.
Sourcepub fn deduplicate(self, deduplicate: bool) -> Self
pub fn deduplicate(self, deduplicate: bool) -> Self
Enable or disable identity-key deduplication.
Sourcepub fn identity(self, identity: PathIdentityOptions) -> Self
pub fn identity(self, identity: PathIdentityOptions) -> Self
Identity options used when deduplicating.
Trait Implementations§
Source§impl Clone for DiscoveryOptions
impl Clone for DiscoveryOptions
Source§fn clone(&self) -> DiscoveryOptions
fn clone(&self) -> DiscoveryOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more