Function infer::is[][src]

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

Determines whether a buffer is of given extension.

Examples

let buf = [0xFF, 0xD8, 0xFF, 0xAA];
assert!(infer::is(&buf, "jpg"));