file_type
Getting Started
File types are determined by examining a file or bytes against known file signatures and file extensions.
Signature, extension and media type data are provided by:
Example
Detect the file type from bytes:
use FileType;
let file_type = from_bytes;
assert_eq!;
assert_eq!;
assert_eq!;
Detect the file type from a file:
use FileType;
use Path;
async
Detect the file type from a file synchronously:
use FileType;
use Path;
let file_path = new;
let file_type = try_from_file_sync.expect;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
Supported File Types
Safety
This crate uses #![forbid(unsafe_code)]
to ensure everything is implemented in 100% safe Rust.
License
Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT)
AND
The PRONOM definitions are provided by The National Archives (UK) under the Open Government Licence.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.