Skip to main content

ScanOptions

Struct ScanOptions 

Source
pub struct ScanOptions {
Show 21 fields pub max_file_bytes: u64, pub extensions: BTreeSet<String>, pub file_types: NamedFileTypes, pub ignore_files: Vec<String>, pub override_rules: Vec<String>, pub ignore_policy: IgnorePolicy, pub ignore_case_insensitive: bool, pub skip_hidden: bool, pub standard_skips: StandardSkips, pub hash_file_contents: bool, pub detect_binary_files: bool, pub evidence: EvidenceMode, pub parallelism: usize, pub traversal_parallelism: Option<usize>, pub content_parallelism: Option<usize>, pub limits: ScanLimits, pub cancellation: Option<CancellationToken>, pub cache_validation: CacheValidationPolicy, pub content_validation: ContentValidationPolicy, pub content_discovery: ContentDiscoveryMode, pub walk: WalkOptions,
}

Fields§

§max_file_bytes: u64§extensions: BTreeSet<String>§file_types: NamedFileTypes

Reusable named file-pattern groups, combined with extensions.

§ignore_files: Vec<String>§override_rules: Vec<String>

High-precedence include/exclude globs using ignore::Override syntax.

§ignore_policy: IgnorePolicy

Controls parent, repository-exclude and global Git ignore sources.

§ignore_case_insensitive: bool

Match ignore patterns without ASCII case sensitivity.

§skip_hidden: bool

Skip dot-prefixed and native Windows-hidden entries unless included.

§standard_skips: StandardSkips§hash_file_contents: bool§detect_binary_files: bool§evidence: EvidenceMode

Record typed evidence for entries excluded by policy.

§parallelism: usize

Traversal and content-inspection workers. Zero selects available parallelism. Retained as the shared backward-compatible default.

§traversal_parallelism: Option<usize>

Optional traversal-only worker override. Some(0) selects available parallelism independently of content inspection.

§content_parallelism: Option<usize>

Optional content-inspection worker override. Some(0) selects available parallelism independently of traversal.

§limits: ScanLimits

Whole-scan resource bounds. All limits are disabled by default.

§cancellation: Option<CancellationToken>

Optional cooperative cancellation signal.

§cache_validation: CacheValidationPolicy

Persistent hash validation policy.

§content_validation: ContentValidationPolicy

New content-read validation policy.

§content_discovery: ContentDiscoveryMode

Candidate-discovery policy for content visits.

§walk: WalkOptions

Low-level traversal policy.

Implementations§

Source§

impl ScanOptions

Source

pub const fn with_max_depth(self, max_depth: Option<usize>) -> Self

Source

pub const fn with_min_depth(self, min_depth: usize) -> Self

Source

pub const fn with_max_open(self, max_open: usize) -> Self

Source

pub const fn with_same_file_system(self, enabled: bool) -> Self

Source

pub const fn with_error_policy(self, policy: ErrorPolicy) -> Self

Source§

impl ScanOptions

Source

pub fn with_extensions<I, S>(self, extensions: I) -> Self
where I: IntoIterator<Item = S>, S: AsRef<str>,

Source

pub fn with_file_types(self, file_types: NamedFileTypes) -> Self

Replaces named file-type definitions and selections.

Source

pub fn with_ignore_files<I, S>(self, names: I) -> Self
where I: IntoIterator<Item = S>, S: AsRef<str>,

Source

pub fn with_override_rules<I, S>(self, rules: I) -> Self
where I: IntoIterator<Item = S>, S: AsRef<str>,

Replaces request-level override globs.

Like ignore::Override, ordinary patterns include matching paths and leading ! patterns exclude them.

Source

pub const fn with_ignore_case_insensitive(self, enabled: bool) -> Self

Source

pub fn with_ignore_policy(self, policy: IgnorePolicy) -> Self

Source

pub const fn with_skip_hidden(self, enabled: bool) -> Self

Source

pub fn metadata_only(self) -> Self

Disables file-content reads for the fastest metadata-only discovery.

The resulting report does not contain content hashes and may include binary files whose extension matches the configured filter.

Source

pub const fn selected_files_only(self) -> Self

Keeps only the selected manifest and warnings, without skip evidence.

Source

pub const fn with_parallelism(self, parallelism: usize) -> Self

Sets the shared traversal and content worker default.

A later traversal- or content-specific override takes precedence.

Source

pub const fn with_traversal_parallelism(self, parallelism: usize) -> Self

Sets traversal workers without changing content-inspection workers.

Source

pub const fn with_content_parallelism(self, parallelism: usize) -> Self

Sets content-inspection workers without changing traversal workers.

Source

pub const fn with_content_discovery(self, mode: ContentDiscoveryMode) -> Self

Sets candidate discovery for content visits.

Source

pub const fn with_max_entries(self, max_entries: Option<u64>) -> Self

Source

pub const fn with_max_total_bytes(self, max_total_bytes: Option<u64>) -> Self

Source

pub const fn with_timeout(self, timeout: Option<Duration>) -> Self

Source

pub fn with_cancellation(self, cancellation: CancellationToken) -> Self

Source

pub const fn with_cache_validation(self, policy: CacheValidationPolicy) -> Self

Source

pub const fn with_content_validation( self, policy: ContentValidationPolicy, ) -> Self

Trait Implementations§

Source§

impl Clone for ScanOptions

Source§

fn clone(&self) -> ScanOptions

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for ScanOptions

Source§

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

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

impl Default for ScanOptions

Source§

fn default() -> Self

Returns the “default value” for a type. 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.