#[non_exhaustive]
pub enum FileType {
Show 35 variants
Zip,
Rar,
Rar5,
Tar,
Lzma,
Xz,
Zst,
Png,
Jpg,
_7z,
Opus,
Vorbis,
Mp3,
Webp,
Flac,
Matroska,
Wasm,
Class,
Tasty,
Mach,
Elf,
Wav,
Avi,
Aiff,
Tiff,
Sqlite3,
Ico,
Dalvik,
Pdf,
DosMzExecutable,
DosZmExecutable,
Xcf,
Gif,
Bmp,
Iso,
}Expand description
All file types that bindet is able to detect, some of them are just different versions of the same format or very similar.
bindet is able to do both, refined detection, which it tries to detect FileType precisely, and general detection, which it tries to do a weaker FileType detection (note: in its current state, it is only doing the precise detection).
A more general categorization is enumerated by FileRootType.
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
Zip
Zip File format, this includes:
- jar
- docx/xlsx/pptx
- Apk
- Aar
- odt/ods/odp
Rar
Rar5
Tar
Tar archive (only uncompressed).
Compressed tar archives are first archived using tar, then compressed, which means that in order to detect compressed tar files we need to decompress them first, which is not viable for this library, and is not part of its goal.
Lzma
Xz
Zst
Png
Jpg
_7z
Opus
Opus Ogg
Vorbis
Vorbis Ogg
Mp3
Webp
Flac
Matroska
All Matroska media containers:
- mkv
- mka
- mks
- mk3d
- webm
Wasm
WebAssembly
Class
Java class
Tasty
Scala Tasty
Mach
Mach-O (untested)
Elf
Executable and Linkable Format
.so*nix executable
Wav
Waveform Audio File Format
Avi
Aiff
Audio Interchange File Format
- aiff
- aif
- aifc
- snd
- iff
Tiff
Tagged Image File Format
- Tiff
- Tif
Sqlite3
SQLite 3 Database
Ico
Dalvik
Dalvik (untested)
Pdf
PDF Document
DosMzExecutable
DOS MZ Executable
.exe.dll
DosZmExecutable
DOS ZM Executable
.exe
Xcf
Gimp XCF
Gif
Gif
Bmp
Bitmap
Iso
Optical Disc Image
Implementations
Trait Implementations
sourceimpl FileTypeDescription for FileType
impl FileTypeDescription for FileType
sourcefn smallest_block_size(
&self,
relative_position: &RelativePosition
) -> Option<usize>
fn smallest_block_size(
&self,
relative_position: &RelativePosition
) -> Option<usize>
Smallest block size to start with and try to detect this file Read more
sourcefn ideal_block_size(
relative_position: &RelativePosition
) -> Option<(usize, Vec<FileType>)>
fn ideal_block_size(
relative_position: &RelativePosition
) -> Option<(usize, Vec<FileType>)>
sourcefn ideal_block_size_of_variants(
relative_position: &RelativePosition,
variants: &[FileType]
) -> Option<(usize, Vec<FileType>)>
fn ideal_block_size_of_variants(
relative_position: &RelativePosition,
variants: &[FileType]
) -> Option<(usize, Vec<FileType>)>
sourcefn maximum_block_size(
relative_position: &RelativePosition
) -> Option<(usize, Vec<FileType>)>
fn maximum_block_size(
relative_position: &RelativePosition
) -> Option<(usize, Vec<FileType>)>
Returns the maximum block size to try when ideal block size
is not enough, along with the filetypes that has large block sizes. Read more
sourcefn maximum_block_size_of_variants(
relative_position: &RelativePosition,
variants: &[FileType]
) -> Option<(usize, Vec<FileType>)>
fn maximum_block_size_of_variants(
relative_position: &RelativePosition,
variants: &[FileType]
) -> Option<(usize, Vec<FileType>)>
Returns the maximum block size to try when ideal block size
is not enough, along with the filetypes that has large block sizes. Read more
sourcefn largest_block_size(
&self,
relative_position: &RelativePosition
) -> Option<usize>
fn largest_block_size(
&self,
relative_position: &RelativePosition
) -> Option<usize>
Largest block size to start with and try to detect this file Read more
sourceimpl FileTypeMatcher for FileType
impl FileTypeMatcher for FileType
sourcefn test(
&self,
relative_position: &RelativePosition,
step: &Step,
bytes: &[u8]
) -> TestResult
fn test(
&self,
relative_position: &RelativePosition,
step: &Step,
bytes: &[u8]
) -> TestResult
Tests if the FileType magic number can be found in the bytes slice.
sourceimpl From<FileType> for FileRootType
impl From<FileType> for FileRootType
impl Copy for FileType
impl Eq for FileType
impl StructuralEq for FileType
impl StructuralPartialEq for FileType
Auto Trait Implementations
impl RefUnwindSafe for FileType
impl Send for FileType
impl Sync for FileType
impl Unpin for FileType
impl UnwindSafe for FileType
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more