pub struct PartialDecode {
pub data: Vec<u8>,
pub start_block: u32,
pub blocks_decoded: u32,
pub stopped_at: Option<(u32, FrameDecoderError)>,
pub frame_finished: bool,
pub resume_state: Option<ResumeState>,
}lsm only.Expand description
Outcome of FrameDecoder::decode_blocks_partial: the decompressed
bytes of the requested inner-block range plus where (if anywhere)
decoding stopped early.
Behind the lsm Cargo feature.
Fields§
§data: Vec<u8>Decompressed bytes of the in-range blocks actually decoded, in
frame order, as one contiguous buffer. data.len() equals the sum
of the decompressed sizes of blocks start_block .. start_block + blocks_decoded.
start_block: u32First block whose output is in data: the requested
start_block on a fresh decode, or ResumeState::block_index when
resuming (the caller-supplied start_block is ignored in resume mode).
blocks_decoded: u32Number of in-range blocks successfully decoded into
data.
stopped_at: Option<(u32, FrameDecoderError)>Some((block_index, error)) if decoding stopped on a failing block
before reaching end_block (a corrupt block inside the range, or a
leading block needed for window context). None if the requested
range decoded cleanly or the frame’s last block was reached first.
When the failing block is a leading context block
(block_index < start_block), the in-range window could not be
built so data is empty and blocks_decoded is 0.
frame_finished: booltrue if the frame’s last block was reached during this decode.
resume_state: Option<ResumeState>Cross-block carry-over state for resuming the next extent. Feed it back
(with the matching window_prime) via the resume argument of a
later FrameDecoder::decode_blocks_partial to continue from
ResumeState::block_index without re-decompressing the prefix.
None in two cases: emission was not requested (emit_resume = false),
OR this decode reached the frame’s last block (frame_finished is
true) — there is no following block to resume from, so no snapshot is
emitted even with emit_resume = true. Callers walking a frame
incrementally should therefore stop when frame_finished is set rather
than treat a None here as “emission disabled”.