Compression at compiletime



is there an include_str! like macro that does compression at compile-time and decompression at execution-time?


I don’t think there’s such a thing. Maybe you could compress the file yourself and use include_bytes!, and decompress that at runtime?


Currently, you’d probably have to do this using a script.


Sounds like a great idea though! Maybe someone could create it?


As you can depend on any crate to be used in this would be quite easy to achieve. You could then use!.html to include a bunch of bytes with the result and then decompress at run-time.

There are a bunch of crates for compression on so you should be able to pick the one that fits your needs best.