pub fn get(buf: &[u8]) -> Option<Type>
Expand description
Returns the file type of the buffer.
§Examples
let info = infer::Infer::new();
let buf = [0xFF, 0xD8, 0xFF, 0xAA];
let kind = info.get(&buf).expect("file type is known");
assert_eq!(kind.mime_type(), "image/jpeg");
assert_eq!(kind.extension(), "jpg");