Crate include_blob

source ·
Expand description

Include large files without the high compile time cost.

This crate provides the include_blob! macro as an alternative to the standard include_bytes! macro, which embeds a file by copying it to an object file and linking to it. This can reduce the (quite high) compile time cost of include_bytes!.

In order for this to work, the user code has to first add a build script that calls the make_includable function.

// build.rs
fn main() {
    include_blob::make_includable("../../directory-with-big-files");
}
let bytes: &[u8] = include_blob::include_blob!("test-project/blobs/file.txt");

Macros§

  • Includes a binary file that was prepared for inclusion by a build script.

Functions§