#directory-recursively #create #compile-time #file-path #byte #read #hash-map

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

Download history 1/week @ 2024-02-14 14/week @ 2024-02-21 14/week @ 2024-02-28 5/week @ 2024-03-13 24/week @ 2024-03-27 40/week @ 2024-04-03

64 downloads per month
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