Skip to main content

Module compression

Module compression 

Source

Structs§

ForwardText
The text of one file, read from the front.

Enums§

Compression
Detected compression format based on magic bytes.
FileContents
Holds file contents either as an owned String or a memory-mapped region.

Functions§

detect_compression
Detect compression format from the first bytes of a file.
detect_compression_from_extension
Detect compression format from a file extension.
gzip_writer
Creates a gzip-compressed writer wrapping a file at the given path.
open_decoded
The bytes of path as one stream, decompressed while it is read.
read_file_contents
Reads file contents, decompressing if needed.
read_file_contents_detected
read_file_contents, also returning the compression it detected.
read_file_text
read_file_contents as one owned String. An uncompressed file is read into it at any size instead of being mapped, so the text is held once and later changes to the file do not reach it.