Expand description
tft
Text file type list and detection similar to that of Neovim
Note: If viewing this file on GitHub or crates.io, some links might not be working. Go to the docs.rs page instead, which also additionally includes the Features section.
Overview
tft
mainly provides the FileType
enum and the detect
and
try_detect
functions. Follow these links for more information.
Features
-
detect
(enabled by default) — Provide thedetect
andtry_detect
functions for detecting a file type from a path and file content -
serde
— Provideserde::Serialize
andserde::Deserialize
implementations forFileType
-
docs
— Enable this when building the docs
Enums
- A non-exhaustive list of text file types.
Functions
- detect
detect
Same astry_detect
but automatically falling back toFileType::Text
wheretry_detect
would returnNone
. - try_detect
detect
Try to detect aFileType
given a file’s path and content.