pub struct PathFilter { /* private fields */ }Expand description
Path filter for controlling which files get indexed.
By default, only files in src/ and tests/ directories are indexed.
Implementations§
Source§impl PathFilter
impl PathFilter
Sourcepub fn new() -> PathFilter
pub fn new() -> PathFilter
Creates an empty path filter with no patterns.
Use PathFilter::default() or PathFilter::new_with_defaults() for the standard filter.
Sourcepub fn new_with_defaults() -> PathFilter
pub fn new_with_defaults() -> PathFilter
Creates a path filter with default settings (src/ and tests/ only).
Sourcepub fn include_dirs(dirs: &[&str]) -> PathFilter
pub fn include_dirs(dirs: &[&str]) -> PathFilter
Creates a path filter that only includes specific directories.
§Arguments
dirs- Directories to include (e.g., [“src”, “tests”])
Sourcepub fn should_index(&self, path: &Path) -> bool
pub fn should_index(&self, path: &Path) -> bool
Checks if a path should be indexed.
A path is indexed if:
- It matches at least one include pattern
- It does NOT match any exclude pattern
- It has an allowed extension (if extensions are specified)
§Arguments
path- The file path to check
Sourcepub fn add_include(&mut self, pattern: impl Into<String>)
pub fn add_include(&mut self, pattern: impl Into<String>)
Adds an include pattern.
Sourcepub fn add_exclude(&mut self, pattern: impl Into<String>)
pub fn add_exclude(&mut self, pattern: impl Into<String>)
Adds an exclude pattern.
Sourcepub fn add_extension(&mut self, ext: impl Into<String>)
pub fn add_extension(&mut self, ext: impl Into<String>)
Adds an allowed extension.
Trait Implementations§
Source§impl Clone for PathFilter
impl Clone for PathFilter
Source§fn clone(&self) -> PathFilter
fn clone(&self) -> PathFilter
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PathFilter
impl Debug for PathFilter
Source§impl Default for PathFilter
impl Default for PathFilter
Source§fn default() -> PathFilter
fn default() -> PathFilter
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PathFilter
impl RefUnwindSafe for PathFilter
impl Send for PathFilter
impl Sync for PathFilter
impl Unpin for PathFilter
impl UnsafeUnpin for PathFilter
impl UnwindSafe for PathFilter
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>
Converts
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>
Converts
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