#[non_exhaustive]pub enum FileType {
Show 39 variants
Zip,
Rar5,
Rar,
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,
Gpg,
ArmoredGpg,
Swf,
Swc,
}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.
§Supported file types
- Zip
- Rar5
- Rar
- 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
- DosMzExecutable
- DosZmExecutable
- Xcf
- Gif
- Bmp
- Iso
- Gpg
- ArmoredGpg
- Swf
- Swc
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
Rar5
Rar
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 Document
DosMzExecutable
DOS MZ Executable
.exe.dll
DosZmExecutable
DOS MZ Executable
.exe
Xcf
Gimp XCF
Gif
Gif
Bmp
Bitmap
Iso
Optical Disc Image
Gpg
ArmoredGpg
Swf
Adobe Small Web Format
Swc
Implementations§
Trait Implementations§
Source§impl FileTypeDescription for FileType
impl FileTypeDescription for FileType
Source§fn smallest_block_size(
&self,
relative_position: &RelativePosition,
) -> Option<usize>
fn smallest_block_size( &self, relative_position: &RelativePosition, ) -> Option<usize>
Source§fn ideal_block_size(
relative_position: &RelativePosition,
) -> Option<(usize, Vec<FileType>)>
fn ideal_block_size( relative_position: &RelativePosition, ) -> Option<(usize, Vec<FileType>)>
Source§fn 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>)>
Source§fn maximum_block_size(
relative_position: &RelativePosition,
) -> Option<(usize, Vec<FileType>)>
fn maximum_block_size( relative_position: &RelativePosition, ) -> Option<(usize, Vec<FileType>)>
ideal block size
is not enough, along with the filetypes that has large block sizes. Read moreSource§fn 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>)>
ideal block size
is not enough, along with the filetypes that has large block sizes. Read moreSource§fn largest_block_size(
&self,
relative_position: &RelativePosition,
) -> Option<usize>
fn largest_block_size( &self, relative_position: &RelativePosition, ) -> Option<usize>
Source§impl FileTypeMatcher for FileType
impl FileTypeMatcher for FileType
Source§fn test(
&self,
relative_position: &RelativePosition,
step: &Step,
bytes: &[u8],
) -> TestResult
fn test( &self, relative_position: &RelativePosition, step: &Step, bytes: &[u8], ) -> TestResult
bytes slice.