pub struct FilterConfig {
pub extensions: HashSet<String>,
pub exclude_dirs: HashSet<String>,
pub exclude_prefixes: Vec<String>,
pub exclude_globs: Vec<Glob>,
pub include_hidden: bool,
}Expand description
Compiled, effective filter configuration. The fields are the
post-normalization output of FilterConfig::build (lowercased,
validated, compiled) — constructing them by hand bypasses that
normalization, so always go through build.
Fields§
§extensions: HashSet<String>Effective extension whitelist (lowercased).
exclude_dirs: HashSet<String>Effective excluded directory names (lowercased, defaults + user).
exclude_prefixes: Vec<String>Effective excluded directory-name prefixes (lowercased).
exclude_globs: Vec<Glob>Compiled user glob patterns.
Whether dot-prefixed entries are processed.
Implementations§
Source§impl FilterConfig
impl FilterConfig
Sourcepub fn build(opts: &FilterOptions) -> Result<FilterConfig, String>
pub fn build(opts: &FilterOptions) -> Result<FilterConfig, String>
Build the effective config. Fatal-input problems (conflicting flags,
malformed globs) return Err → CLI exit code 2.
Sourcepub fn is_excluded_dir_name(&self, name: &OsStr) -> bool
pub fn is_excluded_dir_name(&self, name: &OsStr) -> bool
Case-insensitive directory-name / prefix exclusion check.
True when the dot-prefixed entry must be skipped.
Sourcepub fn is_excluded_by_glob(&self, rel_components: &[&str]) -> bool
pub fn is_excluded_by_glob(&self, rel_components: &[&str]) -> bool
True when any user glob matches the root-relative path components.
Trait Implementations§
Source§impl Clone for FilterConfig
impl Clone for FilterConfig
Auto Trait Implementations§
impl Forget for FilterConfig
impl Freeze for FilterConfig
impl Move for FilterConfig
impl RefUnwindSafe for FilterConfig
impl Send for FilterConfig
impl Sync for FilterConfig
impl Unpin for FilterConfig
impl UnsafeUnpin for FilterConfig
impl UnwindSafe for FilterConfig
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,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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