file-format

Build Crates.io Docs Rust License

File format library for Rust.

This crate is for determining binary-based file formats.

Example

Determines from a file:

```rust use file_format::FileFormat;

let format = FileFormat::fromfile("fixtures/application/sample.zip").unwrap(); asserteq!(format, FileFormat::Zip); asserteq!(format.name(), "ZIP"); asserteq!(format.mediatype(), "application/zip"); asserteq!(format.extension(), "zip"); ```

License

This project is licensed under either of Apache License, Version 2.0 or MIT license at your option.