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 thedetectandtry_detectfunctions for detecting a file type from a path and file contentserde— Provideserde::Serializeandserde::Deserializeimplementations forFileTypedocs— Enable this when building the docs
Enums§
- File
Type - A non-exhaustive list of text file types.
Functions§
- detect
detect - Same as
try_detectbut automatically falling back toFileType::Textwheretry_detectwould returnNone. - try_
detect detect - Try to detect a
FileTypegiven a file’s path and content.