#directory-recursively #create #compile-time #file-path #byte #content #read

nightly include_dir_bytes

Read the directory recursively, and creates a HashMap with these contents at compile time with the file path as the key

3 unstable releases

Uses old Rust 2015

0.2.1 Oct 25, 2017
0.2.0 Oct 25, 2017
0.1.0 Oct 19, 2017

#16 in #directory-recursively


Used in embed_staticfile

MIT license

6KB
84 lines

include_dir_bytes

Read the directory recursively, and creates a HashMap with these contents at compile time with the file path as the key.

Usage

Add this to your Cargo.toml:

[dependencies]
include_dir_bytes = "0.2"

and use it like this:

#![feature(plugin)]
#![plugin(include_dir_bytes)]

// ...

let file_map = include_dir!("path/to/dir");

Dependencies

~53KB