Skip to main content

compress_file

Function compress_file 

Source
pub fn compress_file(
    path: &Path,
    config: &EngineConfiguration,
) -> Result<Vec<u8>>
Expand description

Compress a file at path using memory-mapped zero-copy I/O (FR-009).

This is the preferred entry point for large file inputs. Internally uses memmap2::MmapOptions to avoid copying file contents into a heap buffer before compression.

ยงErrors

  • CrushError::Io โ€” file could not be opened or memory-mapped.
  • CrushError::Cancelled โ€” cancelled via the progress callback.
  • CrushError::InvalidConfig โ€” configuration validation failed.