pub struct ScanConfig {
pub root: PathBuf,
pub follow_symlinks: bool,
pub cross_filesystems: bool,
pub apparent_size: bool,
pub count_hard_links: bool,
pub max_depth: Option<u32>,
pub max_entries: Option<u64>,
pub ignore_patterns: Vec<String>,
pub threads: usize,
pub include_hidden: bool,
pub git_status: bool,
/* private fields */
}Expand description
Configuration for scanning operations.
Fields§
§root: PathBufRoot path to scan.
follow_symlinks: boolFollow symbolic links.
cross_filesystems: boolCross filesystem boundaries.
apparent_size: boolUse apparent size vs disk usage.
count_hard_links: boolCount every hard link to a file instead of only the first one seen.
max_depth: Option<u32>Deepest level kept in the tree (None = unlimited). Everything below is still traversed and counted into the sizes of the deepest kept directories; only the nodes are not retained.
max_entries: Option<u64>Maximum descendant entries consumed after hidden/ignore filtering, at
every depth (max_depth does not reduce the count).
None is unlimited; zero permits only an empty scope. The root does
not count. Metadata failures and unsupported file types still count.
Exceeding the limit fails the scan instead of returning a partial tree.
This is not a bound on walker prefetching, Git enrichment, or total RAM.
ignore_patterns: Vec<String>Patterns to ignore using globset syntax (not gitignore negation rules).
threads: usizeNumber of threads for scanning (0 = auto-detect).
Include hidden files (starting with .).
git_status: boolAnnotate nodes with Git status when the root is inside a repository.
Implementations§
Source§impl ScanConfig
impl ScanConfig
Sourcepub fn builder() -> ScanConfigBuilder
pub fn builder() -> ScanConfigBuilder
Create a new scan config builder.
Sourcepub fn new(root: impl Into<PathBuf>) -> ScanConfig
pub fn new(root: impl Into<PathBuf>) -> ScanConfig
Create a simple config for scanning a path.
Sourcepub fn validate(&self) -> Result<(), String>
pub fn validate(&self) -> Result<(), String>
Validate a directly constructed or deserialized configuration before use.
Sourcepub fn build_ignore_globset(
patterns: &[String],
) -> Result<Option<GlobSet>, String>
pub fn build_ignore_globset( patterns: &[String], ) -> Result<Option<GlobSet>, String>
Compile every supplied pattern, rejecting invalid patterns as a unit.
Sourcepub fn effective_ignore_globset(&self) -> Result<Option<GlobSet>, String>
pub fn effective_ignore_globset(&self) -> Result<Option<GlobSet>, String>
Return a compiled snapshot of the current patterns, never a stale cache.
Sourcepub fn compile_patterns(&mut self) -> Result<(), String>
pub fn compile_patterns(&mut self) -> Result<(), String>
Cache the current valid patterns. Public-field mutations are detected automatically; callers need not manually invalidate this cache.
Sourcepub fn should_ignore(&self, name: &str) -> Result<bool, String>
pub fn should_ignore(&self, name: &str) -> Result<bool, String>
Match a name, returning an error if any configured pattern is invalid.
Check if hidden files should be skipped.
Trait Implementations§
Source§impl Clone for ScanConfig
impl Clone for ScanConfig
Source§fn clone(&self) -> ScanConfig
fn clone(&self) -> ScanConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ScanConfig
impl Debug for ScanConfig
Source§impl Default for ScanConfig
impl Default for ScanConfig
Source§fn default() -> ScanConfig
fn default() -> ScanConfig
Source§impl<'de> Deserialize<'de> for ScanConfig
impl<'de> Deserialize<'de> for ScanConfig
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ScanConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ScanConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for ScanConfig
impl Serialize for ScanConfig
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for ScanConfig
impl RefUnwindSafe for ScanConfig
impl Send for ScanConfig
impl Sync for ScanConfig
impl Unpin for ScanConfig
impl UnsafeUnpin for ScanConfig
impl UnwindSafe for ScanConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more