Skip to main content

ZSTD_DStream

Type Alias ZSTD_DStream 

Source
pub type ZSTD_DStream = ZSTD_DCtx;
Expand description

Port of ZSTD_DStream. Upstream typedef ZSTD_DCtx ZSTD_DStream — same struct for both APIs.

Aliased Type§

pub struct ZSTD_DStream {
Show 52 fields pub hufTable: Vec<u32>, pub workspace: Vec<u32>, pub litExtraBuffer: Vec<u8>, pub litBuffer_offset: usize, pub litBufferEnd_offset: usize, pub litBufferLocation: ZSTD_litLocation_e, pub litPtr_offset: usize, pub litPtr_from_dst: bool, pub litSize: usize, pub litEntropy: u32, pub dictID: u32, pub ddict_rep: [u32; 3], pub previousDstEnd: Option<usize>, pub prefixStart: Option<usize>, pub virtualStart: Option<usize>, pub dictEnd: Option<usize>, pub isFrameDecompression: i32, pub blockSizeMax: usize, pub disableHufAsm: i32, pub bmi2: i32, pub ddictIsCold: i32, pub LLTable: Vec<ZSTD_seqSymbol>, pub OFTable: Vec<ZSTD_seqSymbol>, pub MLTable: Vec<ZSTD_seqSymbol>, pub ll_default_active: bool, pub of_default_active: bool, pub ml_default_active: bool, pub fseEntropy: u32, pub fse_ll_fresh: bool, pub fse_of_fresh: bool, pub fse_ml_fresh: bool, pub stream_in_buffer: Vec<u8>, pub stream_out_buffer: Vec<u8>, pub stream_out_drained: usize, pub oversizedDuration: usize, pub stream_dict: Vec<u8>, pub historyBuffer: Vec<u8>, pub d_windowLogMax: u32, pub format: ZSTD_format_e, pub expected: usize, pub stage: ZSTD_dStage, pub processedCSize: u64, pub decodedSize: u64, pub fParams: ZSTD_FrameHeader, pub bType: blockType_e, pub validateChecksum: u32, pub xxhState: XXH64_state_t, pub headerBuffer: [u8; 18], pub headerSize: usize, pub rleSize: usize, pub dictUses: ZSTD_dictUses_e, pub customMem: ZSTD_customMem,
}

Fields§

§hufTable: Vec<u32>

Huffman decoding table, sized for HUF_TABLELOG_MAX.

§workspace: Vec<u32>

Scratch space for HUF_read*DTable*_wksp.

§litExtraBuffer: Vec<u8>

Literal-buffer scratch; owned when litBufferLocation == ZSTD_not_in_dst.

§litBuffer_offset: usize

Pointer-equivalent into litExtraBuffer or dst (as a byte index plus a tag). A real port will use an enum over &mut [u8] slices once DCtx lifetimes are settled.

§litBufferEnd_offset: usize§litBufferLocation: ZSTD_litLocation_e§litPtr_offset: usize§litPtr_from_dst: bool§litSize: usize§litEntropy: u32§dictID: u32

Upstream dctx->dictID. Parsed from a zstd-format dict’s 4-byte ID field when one is loaded; 0 for raw-content dicts.

§ddict_rep: [u32; 3]

Upstream dctx->ddict_rep[ZSTD_REP_NUM]. Rep values parsed from a zstd-format dict’s trailing 12-byte rep section.

§previousDstEnd: Option<usize>

End pointer-equivalent of the prior decode/insert destination.

§prefixStart: Option<usize>

Start pointer-equivalent of the current history segment.

§virtualStart: Option<usize>

Virtual start pointer-equivalent spanning the current segment plus the immediately-previous contiguous one.

§dictEnd: Option<usize>

End pointer-equivalent of the previous segment once continuity is broken and it becomes an external dictionary.

§isFrameDecompression: i32

isFrameDecompression toggles ZSTD_blockSizeMax behaviour; for standalone block decode (our current scope) it’s 0.

§blockSizeMax: usize

Most fParams fields are unused in the literal-block decode; keep just the block-size cap we read in frame mode.

§disableHufAsm: i32§bmi2: i32§ddictIsCold: i32§LLTable: Vec<ZSTD_seqSymbol>§OFTable: Vec<ZSTD_seqSymbol>§MLTable: Vec<ZSTD_seqSymbol>§ll_default_active: bool§of_default_active: bool§ml_default_active: bool§fseEntropy: u32§fse_ll_fresh: bool

1 if the last sequences block had its FSE tables fresh (set_compressed) — gates set_repeat validity for the next block of the same type. Upstream tracks this as a bitmask inside dctx->fseEntropy; here we keep it as three independent flags.

§fse_of_fresh: bool§fse_ml_fresh: bool§stream_in_buffer: Vec<u8>

Pending compressed bytes staged by ZSTD_decompressStream.

§stream_out_buffer: Vec<u8>

Decoded output awaiting drain into the caller’s output buffer.

§stream_out_drained: usize

Bytes already drained from stream_out_buffer into the caller.

§oversizedDuration: usize

Upstream oversizedDuration: number of consecutive streaming calls whose retained buffers are much larger than the needed input/output workspace.

§stream_dict: Vec<u8>

Raw-content dict set by ZSTD_initDStream_usingDict — applied to every frame decoded until reset / re-init.

§historyBuffer: Vec<u8>

Sliding history of prior-block output, retained across ZSTD_decompressContinue calls so back-references in later blocks can resolve into earlier-block bytes that no longer live in the caller’s dst. Capped at fParams.windowSize (or ZSTD_BLOCKSIZE_MAX before a frame header has been parsed). Reset on frame boundaries and on ZSTD_decompressBegin.

§d_windowLogMax: u32

ZSTD_d_windowLogMax: upper bound on the window size the decoder will accept. Set via ZSTD_DCtx_setParameter.

§format: ZSTD_format_e

Upstream dctx->format. Selected decoder format — zstd1 (with magic) or zstd1_magicless (for embedded / streaming contexts where the 4-byte magic is known redundantly).

§expected: usize

Legacy decompressContinue() expected compressed-byte count for the next state-machine transition.

§stage: ZSTD_dStage

Legacy block/frame decode stage.

§processedCSize: u64

Running compressed bytes consumed by the legacy continue API.

§decodedSize: u64

Running decompressed bytes produced for the current frame.

§fParams: ZSTD_FrameHeader

Frame header decoded for the current frame.

§bType: blockType_e

Block type latched from the most recent block header.

§validateChecksum: u32

Whether to validate the checksum trailer for the current frame.

§xxhState: XXH64_state_t

XXH64 state for checksum validation in the legacy continue API.

§headerBuffer: [u8; 18]

Full frame/skippable header bytes staged across split calls.

§headerSize: usize

Full header size expected for headerBuffer.

§rleSize: usize

Current RLE block’s regenerated size.

§dictUses: ZSTD_dictUses_e

Upstream dctx->dictUses (zstd_decompress_internal.h:97). Tracks the dict lifecycle: ZSTD_dont_use = no dict attached; ZSTD_use_once = refPrefix-bound dict that auto-clears after one frame; ZSTD_use_indefinitely = persistent dict from loadDictionary / refDDict.

§customMem: ZSTD_customMem

Upstream custom allocator bundle requested for this DCtx.