Skip to main content

detect

Function detect 

Source
pub fn detect(content: &[u8]) -> ContentType
Expand description

Classify a clip from raw bytes. Never returns Image.

Bytes input avoids an O(n) UTF-8 scan on large clipboard payloads: callers can pass &Vec<u8> directly (e.g. cinch push stdin), and this function caps both the byte buffer and the UTF-8 validation at MAX_CLASSIFY_BYTES — anything past that boundary cannot affect the classification decision anyway.