[][src]Function zstd_safe::get_dict_id_from_frame

pub fn get_dict_id_from_frame(src: &[u8]) -> u32

ZSTD_getDictID_fromFrame()

Provides the dictID required to decompressed the frame stored within src.

If @return == 0, the dictID could not be decoded.

This could for one of the following reasons :

  • The frame does not require a dictionary to be decoded (most common case).
  • The frame was built with dictID intentionally removed. Whatever dictionary is necessary is a hidden information. Note : this use case also happens when using a non-conformant dictionary.
  • srcSize is too small, and as a result, the frame header could not be decoded (only possible if srcSize < ZSTD_FRAMEHEADERSIZE_MAX).
  • This is not a Zstandard frame.

When identifying the exact failure cause, it's possible to use ZSTD_getFrameParams(), which will provide a more precise error code.