Skip to main content

detect

Function detect 

Source
pub fn detect(data: &[u8]) -> Result<Format>
Expand description

Identify data by content.

§Errors

Returns StryptError::UnsupportedFormat when the content is recognised but has no handler in this release, and StryptError::UnrecognisedFormat when it matches nothing. Both are reported to the user; neither is ever treated as “pass the file through unchanged”, which is the failure this whole module exists to prevent.