#compile-time #macro #file-content #binary #proc-macro #deflate #flate2

macro include_file_compress

Includes content of file in your binary with compression at compile time

4 releases

0.1.3 Apr 26, 2024
0.1.2 Apr 24, 2024
0.1.1 Apr 24, 2024
0.1.0 Apr 24, 2024

#323 in Compression

Download history 36/week @ 2024-07-27 5/week @ 2024-09-21

108 downloads per month

MIT license

11KB
106 lines

Include file with compile-time compression

This procedural macros includes content of file in your binary with compression at compile time.

It can be useful for including static content of CSS, JS files with compression in compile time.

At this moment deflate compression using flate2 library is supported only.

Example

use include_file_compress::include_file_compress_deflate;

let _compressed =
    include_file_compress_deflate!("data_samples/data.txt", 5);

Dependencies

~0.6–1.2MB
~25K SLoC