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 contentserde
— Provideserde::Serialize
andserde::Deserialize
implementations forFileType
docs
— Enable this when building the docs
Enums§
- File
Type - A non-exhaustive list of text file types.
Functions§
- detect
detect
- Same as
try_detect
but automatically falling back toFileType::Text
wheretry_detect
would returnNone
. - try_
detect detect
- Try to detect a
FileType
given a file’s path and content.