pub struct FileFilter { /* private fields */ }
Expand description
High-performance file filter with strict pre-filtering
Implementations§
Source§impl FileFilter
impl FileFilter
Sourcepub fn with_allow_extensions(self, extensions: Vec<String>) -> Self
pub fn with_allow_extensions(self, extensions: Vec<String>) -> Self
Set custom extension allowlist (only these extensions will be processed)
Sourcepub fn with_deny_extensions(self, extensions: Vec<String>) -> Self
pub fn with_deny_extensions(self, extensions: Vec<String>) -> Self
Add extensions to the deny list
Sourcepub fn with_max_file_size(self, size: u64) -> Self
pub fn with_max_file_size(self, size: u64) -> Self
Set maximum file size
Set whether to include hidden files
Sourcepub fn with_binary_detection(self, detect: bool) -> Self
pub fn with_binary_detection(self, detect: bool) -> Self
Set whether to perform binary detection
Sourcepub fn pre_filter_path(&mut self, path: &Path) -> FilterResult
pub fn pre_filter_path(&mut self, path: &Path) -> FilterResult
Pre-filter a file path without reading contents
Sourcepub async fn filter_file(&mut self, path: &Path) -> FilterResult
pub async fn filter_file(&mut self, path: &Path) -> FilterResult
Full filter including file size and binary detection
Sourcepub async fn is_binary_file(&mut self, path: &Path) -> bool
pub async fn is_binary_file(&mut self, path: &Path) -> bool
Fast binary file detection using content sampling
Sourcepub fn stats(&self) -> &FilterStats
pub fn stats(&self) -> &FilterStats
Get filtering statistics
Sourcepub fn reset_stats(&mut self)
pub fn reset_stats(&mut self)
Reset statistics
Trait Implementations§
Source§impl Debug for FileFilter
impl Debug for FileFilter
Auto Trait Implementations§
impl Freeze for FileFilter
impl RefUnwindSafe for FileFilter
impl Send for FileFilter
impl Sync for FileFilter
impl Unpin for FileFilter
impl UnwindSafe for FileFilter
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
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