Registry / utility / tree-magic

tree-magic

JSON →
library0.2.3rscratesunverified

Determines the MIME type of a file by traversing a filetype tree.

# Cargo.toml [dependencies] tree_magic = "0.2.3"
INSTALL
IMPORT
SIG · TREE-MAGIC
T
tree-magic
utilityrustv0.2.3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

from_filepath
use tree_magic::from_filepath;

Gets the MIME type of a file by path.

use tree_magic::from_filepath; use std::path::Path; let mime = from_filepath(Path::new("example.txt")); assert_eq!(mime, "text/plain");
Debug
Known issues

No known issues recorded.

Upgrade
Version history
0.2.3latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
tree-magic — cargo add tree-magic · libregistry