embeddir 0.1.1

A macro for embedding all files in a directory into the executable
Documentation
  • Coverage
  • 100%
    2 out of 2 items documented1 out of 1 items with examples
  • Size
  • Source code size: 6.98 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 269.93 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 4s Average build duration of successful builds.
  • all releases: 4s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • PonasKovas/embeddir
    1 0 1
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • PonasKovas

embeddir

Crates.io

A macro that embeds all files in a specified directory into the executable at compile-time.

Works similarly to include_bytes! macro.

Usage example

#![feature(proc_macro_hygiene)]

fn main() {
	let dir = embeddir::embed!("examples/static");

	for (filename, contents) in &dir {
		println!("Filename: {}, Contents: \"{}\"",
        filename,
        std::str::from_utf8(contents).unwrap());
	}
}