Function infer::is_mime[][src]

pub fn is_mime(buf: &[u8], mime_type: &str) -> bool
Expand description

Determines whether a buffer is of given mime type.

Examples

let buf = [0xFF, 0xD8, 0xFF, 0xAA];
assert!(infer::is_mime(&buf, "image/jpeg"));