Function webc::detect

source ·
pub fn detect(reader: impl Read) -> Result<Version, DetectError>
Expand description

Check whether something looks like a valid WEBC file and extract its version number.

This will not apply any validation or check that the rest of the file is correct.

Examples

let buffer = b"\0webc002";
let version = webc::detect(&buffer[..])?;
assert_eq!(version, Version::V2);