Repository navigation
v0.1.0
Changed
- (decode) [breaking] start the first frame on the first read (#561)
Migrating from 0.0.x
StreamingDecoder::new and StreamingDecoder::new_with_decoder return the decoder itself instead of a Result. They read nothing from the source: the first frame header, any skippable frames in front of it, and their errors (an empty source, input that is not zstd, a damaged header) come from the first read or read_to_end, as an io::Error carrying the FrameDecoderError.
// 0.0.x
let mut decoder = StreamingDecoder::new(source)?;
// 0.1.0
let mut decoder = StreamingDecoder::new(source);
decoder.read_to_end(&mut out)?; // a bad first frame fails here- A decoder that was built but never read hands its source back untouched through
into_inner, and a damaged first frame no longer drops an owned source: the read fails andinto_innerstill returns it. - The dictionary constructors (
new_with_dictionary_handle,new_with_dictionary_bytes,new_with_decoder_and_dictionary_handle) still return aResult, which now fails only on dictionary content. FrameDecoderError::FailedToReadSkippableFrameis removed: a source error inside a leading skippable frame comes back as the source reported it.