pub struct MetadataExtractor { /* private fields */ }Expand description
Metadata extractor with caching and optimization
Implementations§
Source§impl MetadataExtractor
impl MetadataExtractor
Sourcepub fn without_cache() -> Self
pub fn without_cache() -> Self
Create a metadata extractor without caching
Sourcepub async fn extract_metadata(&self, path: &Path) -> Result<FileMetadata>
pub async fn extract_metadata(&self, path: &Path) -> Result<FileMetadata>
Extract comprehensive metadata for a file
Sourcepub async fn extract_metadata_batch(
&self,
paths: &[PathBuf],
) -> Vec<Result<FileMetadata>> ⓘ
pub async fn extract_metadata_batch( &self, paths: &[PathBuf], ) -> Vec<Result<FileMetadata>> ⓘ
Extract metadata for multiple files in parallel
Sourcepub fn calculate_size_stats(&self, files: &[FileMetadata]) -> SizeStats
pub fn calculate_size_stats(&self, files: &[FileMetadata]) -> SizeStats
Calculate size statistics for a collection of files
Sourcepub fn clear_cache(&self)
pub fn clear_cache(&self)
Clear the metadata cache
Sourcepub fn cache_stats(&self) -> (usize, usize)
pub fn cache_stats(&self) -> (usize, usize)
Get cache statistics
Sourcepub fn is_likely_text_file(&self, metadata: &FileMetadata) -> bool
pub fn is_likely_text_file(&self, metadata: &FileMetadata) -> bool
Check if a file is likely to be a text file based on metadata
Sourcepub fn is_recently_modified(&self, metadata: &FileMetadata, hours: u64) -> bool
pub fn is_recently_modified(&self, metadata: &FileMetadata, hours: u64) -> bool
Check if a file has been modified recently
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MetadataExtractor
impl !RefUnwindSafe for MetadataExtractor
impl Send for MetadataExtractor
impl Sync for MetadataExtractor
impl Unpin for MetadataExtractor
impl UnwindSafe for MetadataExtractor
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