pub struct FileIdentifier { /* private fields */ }Expand description
Configuration for file identification behavior.
Allows customizing which analysis steps to perform and their order.
Use FileIdentifier::new() to create a builder and customize identification.
Implementations§
Source§impl FileIdentifier
impl FileIdentifier
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new file identifier with default settings.
By default, all analysis steps are enabled:
- File system metadata analysis
- Filename and extension analysis
- Shebang analysis for executable files
- Content analysis (text vs binary detection)
Sourcepub fn skip_content_analysis(self) -> Self
pub fn skip_content_analysis(self) -> Self
Skip content analysis (text vs binary detection).
This avoids reading file contents, making identification faster but potentially less accurate for files without clear extension/filename patterns.
Sourcepub fn skip_shebang_analysis(self) -> Self
pub fn skip_shebang_analysis(self) -> Self
Skip shebang analysis for executable files.
This avoids parsing shebang lines, making identification faster but less accurate for executable scripts without recognized extensions.
Sourcepub fn with_custom_extensions(self, extensions: HashMap<String, TagSet>) -> Self
pub fn with_custom_extensions(self, extensions: HashMap<String, TagSet>) -> Self
Add custom file extension mappings.
These will be checked before the built-in extension mappings. Useful for organization-specific or project-specific file types.
Trait Implementations§
Source§impl Clone for FileIdentifier
impl Clone for FileIdentifier
Source§fn clone(&self) -> FileIdentifier
fn clone(&self) -> FileIdentifier
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more