Module core

Source
Expand description

Streaming decompression functionality.

Modulesยง

inflate_flags
Flags to decompress() to control how inflation works.

Macrosยง

generate_state ๐Ÿ”’

Structsยง

DecompressorOxide
Main decompression struct.
HuffmanTable ๐Ÿ”’
A struct containing huffman code lengths and the huffman code tree used by the decompressor.
LocalVars ๐Ÿ”’

Enumsยง

Action ๐Ÿ”’
State ๐Ÿ”’

Constantsยง

BASE_EXTRA_MASK ๐Ÿ”’
The mask used when indexing the base/extra arrays.
DIST_BASE ๐Ÿ”’
Base length for each distance code.
DIST_TABLE ๐Ÿ”’
FAST_LOOKUP_BITS ๐Ÿ”’
The maximum length of a code that can be looked up in the fast lookup table.
FAST_LOOKUP_SIZE ๐Ÿ”’
The size of the fast lookup table.
HUFFLEN_TABLE ๐Ÿ”’
LENGTH_BASE ๐Ÿ”’
Base length for each length code.
LENGTH_EXTRA ๐Ÿ”’
Number of extra bits for each length code.
LEN_CODES_MASK ๐Ÿ”’
LEN_CODES_SIZE ๐Ÿ”’
LITLEN_TABLE ๐Ÿ”’
MAX_HUFF_SYMBOLS_0 ๐Ÿ”’
The length of the first (literal/length) huffman table.
MAX_HUFF_SYMBOLS_1 ๐Ÿ”’
The length of the second (distance) huffman table.
MAX_HUFF_SYMBOLS_2 ๐Ÿ”’
The length of the last (huffman code length) huffman table.
MAX_HUFF_TABLES ๐Ÿ”’
The number of huffman tables used.
MAX_HUFF_TREE_SIZE ๐Ÿ”’
MIN_TABLE_SIZES ๐Ÿ”’
TINFL_LZ_DICT_SIZE

Functionsยง

apply_match ๐Ÿ”’
Presumes that there is at least match_len bytes in output left.
decode_huffman_code ๐Ÿ”’
Try to decode the next huffman code, and puts it in the counter field of the decompressor if successful.
decompress
Main decompression function. Keeps decompressing data from in_buf until the in_buf is empty, out is full, the end of the deflate stream is hit, or there is an error in the deflate stream.
decompress_fast ๐Ÿ”’
Fast inner decompression loop which is run while there is at least 259 bytes left in the output buffer, and at least 6 bytes left in the input buffer (The maximum one match would need + 1).
end_of_input ๐Ÿ”’
fill_bit_buffer ๐Ÿ”’
Ensure that there is data in the bit buffer.
init_tree ๐Ÿ”’
num_extra_bits_for_distance_code ๐Ÿ”’
Get the number of extra bits used for a distance code. (Code numbers above NUM_DISTANCE_CODES will give some garbage value.)
pad_to_bytes ๐Ÿ”’
read_bits ๐Ÿ”’
Try to read amount number of bits from in_iter and call the function f with the bits as an an argument after reading, returning the result of that function, or Action::End if there are not enough bytes left.
read_byte ๐Ÿ”’
Try to read one byte from in_iter and call f with the read byte as an argument, returning the result. If reading fails, Action::End is returned
read_u16_le ๐Ÿ”’
Read an le u16 value from the slice iterator.
reverse_bits ๐Ÿ”’
start_static_table ๐Ÿ”’
transfer ๐Ÿ”’
undo_bytes ๐Ÿ”’
validate_zlib_header ๐Ÿ”’
Check that the zlib header is correct and that there is enough space in the buffer for the window size specified in the header.

Type Aliasesยง

BitBuffer ๐Ÿ”’