#[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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.

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

Gets all variants of FileType

Gets the FileRootType of this FileType

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Smallest block size to start with and try to detect this file Read more

Returns the ideal block size to start with and the filetypes that has an starting block size. Read more

Returns the ideal block size to start with and the filetypes that has an starting block size. Read more

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

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

Largest block size to start with and try to detect this file Read more

Tests if the FileType magic number can be found in the bytes slice.

Converts to this type from the input type.

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.