#[non_exhaustive]pub struct DiscoveryOptions {
pub follow_symlinks: bool,
pub max_depth: u32,
pub max_file_size_bytes: u64,
pub max_total_files: u64,
pub exclude_globs: Arc<GlobSet>,
pub module_globs: Arc<GlobSet>,
pub threads: u32,
}Expand description
Discovery configuration (caps, excludes, classification hints).
Build via the generated [DiscoveryOptionsBuilder].
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.follow_symlinks: boolWhether the walker follows symlinks. Default: false.
max_depth: u32Maximum walk depth, measured in directory levels below the workspace
root. Default: 16 per [70-security.md § 3.2].
max_file_size_bytes: u64Maximum byte size for any individual file. Files exceeding this cap
are skipped with a crate::diagnostic::LimitKind::FileSize
diagnostic. Default: 8 MiB.
max_total_files: u64Workspace-wide cap on the total number of files visited. Breaching
this returns crate::Error::Limit (fatal). Default: 200_000 per
[70-security.md § 3.2].
exclude_globs: Arc<GlobSet>Compiled exclude glob set (defaults plus user-supplied entries). Anything matching is dropped from the walk before classification.
module_globs: Arc<GlobSet>Compiled module-glob set. A directory whose path matches is pre-classified as a module before the file-content heuristics run (per [11-discovery.md § 3.2 rule 1]).
threads: u32Number of walker threads (capped at MAX_DISCOVERY_THREADS). The
current sequential walker ignores this value but it is reserved for
the parallel implementation that lands in Phase 9.
Implementations§
Source§impl DiscoveryOptions
impl DiscoveryOptions
Sourcepub fn builder() -> DiscoveryOptionsBuilder<((), (), (), (), (), (), ())>
pub fn builder() -> DiscoveryOptionsBuilder<((), (), (), (), (), (), ())>
Create a builder for building DiscoveryOptions.
On the builder, call .follow_symlinks(...)(optional), .max_depth(...)(optional), .max_file_size_bytes(...)(optional), .max_total_files(...)(optional), .exclude_globs(...)(optional), .module_globs(...)(optional), .threads(...)(optional) to set the values of the fields.
Finally, call .build() to create the instance of DiscoveryOptions.
Source§impl DiscoveryOptions
impl DiscoveryOptions
Sourcepub fn defaults() -> Self
pub fn defaults() -> Self
Build the spec defaults: max_depth=16, max_file_size=8 MiB,
max_total_files=200_000, follow_symlinks=false, default
excludes (.git, .terraform, .terragrunt-cache), default module
globs (modules/**, **/modules/*).
Sourcepub const fn effective_threads(&self) -> u32
pub const fn effective_threads(&self) -> u32
The configured threads value clamped to MAX_DISCOVERY_THREADS.
Used by the (forthcoming) parallel walker; surfaced now so callers
can introspect the effective value without re-implementing the cap.
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