Skip to content

v0.14.2

Latest

Choose a tag to compare

@gyscos gyscos released this 10 Oct 13:52
· 46 commits to main since this release

zstd 0.14.2

This release adds decoder APIs that let archive libraries recover their readers
without consuming more compressed input or losing ownership on initialization
errors.

  • Add stream::read::Decoder::into_inner(), which returns the underlying reader
    at its current position without additional I/O. This supports raw copying of
    compressed archive entries. Addresses #381
    and the regression reported in #380.
  • Add Decoder::try_new, try_with_buffer, try_with_dictionary,
    try_with_prepared_dictionary, and try_with_ref_prefix. These return
    Result<Self, (R, io::Error)>, preserving the original reader if decoder
    initialization fails. Addresses #382.
  • Return an I/O error if a streaming decoder cannot allocate its decompression
    context, instead of panicking.
  • Clarify that finish_frame() can stop before the end of a frame when decoded
    output remains unread.

Decoder::finish() keeps its 0.14 behavior: it attempts to consume remaining
frame input before returning the reader. Archive libraries that need to recover
compressed bytes should use into_inner() and adopt the new try_* constructors
where they need to retain the reader after initialization failure. Existing
constructor signatures remain unchanged.

Rust 1.64 remains supported.