Crate tika_magic

Source
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.

Type Aliases§

Mime