inline-blob 0.1.0

Gigabyte-class BLOB embedding macro for x86_64 ELF
Documentation
  • Coverage
  • 100%
    2 out of 2 items documented0 out of 1 items with examples
  • Size
  • Source code size: 33.2 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 117.0 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 5s Average build duration of successful builds.
  • all releases: 5s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • metastable-void/inline-blob
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • metastable-void

inline-blob

A proc_macro Rust crate that allows you to include gigabytes of data inline in binaries (including lib crates).

How it works

This expands:

use inline_blob::blob;

blob!(pub static MY_DATA, "path/to/data/bin");

into something like:

#[used]
#[unsafe(link_section = ".lrodata.my_data")]
pub static MY_DATA: [u8; _] = *include_bytes!("path/to/bin");

Visibility is supported.

use inline_blob::blob;

blob!(pub(crate) static MY_DATA, "path/to/bin");

is expanded into something like:

#[used]
#[unsafe(link_section = ".lrodata.my_data")]
pub(crate) static MY_DATA: [u8; _] = *include_bytes!("path/to/bin");

We only tested this crate for x86_64 ELF targets (specifically musl and GNU).