Skip to main content

is_frame

Function is_frame 

Source
pub fn is_frame(src: &[u8]) -> bool
Expand description

Whether src starts with a frame this build decodes or skips: a Zstandard frame, a skippable frame, or with the legacy feature a v0.5-v0.7 frame. Backs the C ZSTD_isFrame, which answers the same for upstream’s default build.

use structured_zstd::decoding::is_frame;
assert!(is_frame(&[0x28, 0xB5, 0x2F, 0xFD]));
assert!(is_frame(&[0x50, 0x2A, 0x4D, 0x18]));
assert!(!is_frame(b"zip"));