Expand description
§Example
// Load a GIF file
let input: &[u8] = include_bytes!("../tests/inputs/image/gif/gif.gif");
// Check if the MIME and the file are a match
let result = tika_magic::match_u8("image/gif", input);
assert_eq!(result, true);Functions§
- from_
file - Gets the MIME type for a file.
- from_
file_ exhaustive - Gets all the MIME types that match a file.
- from_
filepath - Gets the MIME type for a path
- from_
filepath_ exhaustive - Gets all the MIME types that match for a path.
- from_u8
- Gets the MIME from a byte stream.
- from_
u8_ exhaustive - Gets the MIME types that match a byte stream.
- match_
file - Check if the given file matches the given MIME type.
- match_
filepath - Check if the file at the given path matches the given MIME type.
- match_
u8 - Checks if the given bytestream matches the given MIME type.