Skip to main content

Crate zrip_encode

Crate zrip_encode 

Source
Expand description

zstd encoder of zrip: levels -7 to 4, the Fast and DFast match finders, the block encoder, and the one-shot, context, streaming and push APIs. Use zrip unless you need only the compressor.

Modules§

adaptive
Compression level adaptation for a sender whose bottleneck moves.
context
CompressContext, which reuses tables and buffers across frames, and the dictionary state it prepares once.
push
Push-style (sans-io) encoding: the caller feeds input chunks and drains frame bytes into its own buffers.
strategy
Level parameters: the settings each level runs with, and how the input size and Options adjust them.
streaming
FrameEncoder, a streaming encoder over std::io::Write.

Functions§

compress
Compresses input into one frame at level (-7..=4; -8 runs as -7, 0 as 1). The frame records the content size and a checksum. Other levels fail with CompressError::InvalidLevel.
compress_into
compress into output. Returns the frame size. Fails with CompressError::OutputTooSmall if the frame does not fit; output then holds a partial frame. zrip::compress_bound(input.len()) bytes are always enough.
compress_opts
compress with strategy::Options: a larger window or long distance matching. The window shrinks to the input.
compress_with_dict
compress with dict. Decoders need the same dictionary.
compress_with_params
compress with explicit params instead of a level. The table and window logs are clamped to their valid ranges and to the input size.