Crate embed_file

Source
Expand description

License Crates.io Docs.rs

§embed-file

A simplified version of rust-embed for single files instead of folders. Embeds files content into the binary in release mode, but loads it from the fs in debug.

The goal of is to avoid unnecessary recompilations when an included by e.g. include_str file change.

§Usage

let my_string = embed_file::embed_string!("path/to/my-text.txt");
let my_image = embed_file::embed_bytes!("path/to/my-image.jpg");

§Contributing

  • please run .pre-commit.sh before sending a PR, it will check everything

§License

This project is licensed under the MIT license.

Macros§

embed_bytes
Embeds the file contents as bytes into the binary in release mode, but loads it from the filesystem in debug.
embed_string
Embeds the file contents as a string into the binary in release mode, but loads it from fs in debug.