Skip to main content

ScanConfig

Struct ScanConfig 

Source
pub struct ScanConfig {
    pub root: PathBuf,
    pub follow_symlinks: bool,
    pub cross_filesystems: bool,
    pub apparent_size: bool,
    pub max_depth: Option<u32>,
    pub ignore_patterns: Vec<String>,
    pub threads: usize,
    pub include_hidden: bool,
    pub compute_hashes: bool,
    pub min_hash_size: u64,
    /* private fields */
}
Expand description

Configuration for scanning operations.

Fields§

§root: PathBuf

Root path to scan.

§follow_symlinks: bool

Follow symbolic links.

§cross_filesystems: bool

Cross filesystem boundaries.

§apparent_size: bool

Use apparent size vs disk usage.

§max_depth: Option<u32>

Maximum depth to traverse (None = unlimited).

§ignore_patterns: Vec<String>

Patterns to ignore (gitignore-style glob syntax via globset).

§threads: usize

Number of threads for scanning (0 = auto-detect).

§include_hidden: bool

Include hidden files (starting with .).

§compute_hashes: bool

Compute content hashes during scan.

§min_hash_size: u64

Minimum file size to hash (skip tiny files).

Implementations§

Source§

impl ScanConfig

Source

pub fn builder() -> ScanConfigBuilder

Create a new scan config builder.

Source

pub fn new(root: impl Into<PathBuf>) -> Self

Create a simple config for scanning a path.

Source

pub fn compile_patterns(&mut self)

Compile ignore patterns into a GlobSet for efficient matching. Call this after modifying ignore_patterns.

Source

pub fn should_ignore(&self, name: &str) -> bool

Check if a name should be ignored based on compiled glob patterns.

Source

pub fn compiled_ignore_set(&self) -> Option<&GlobSet>

Return the compiled GlobSet for ignore patterns, if any.

This is the same set used internally by should_ignore. Useful when callers need an owned, Send + Sync handle (e.g. for closures sent to thread pools) without recompiling the patterns.

Source

pub fn should_skip_hidden(&self, name: &str) -> bool

Check if hidden files should be skipped.

Trait Implementations§

Source§

impl Clone for ScanConfig

Source§

fn clone(&self) -> ScanConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ScanConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ScanConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for ScanConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for ScanConfig

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,