include-files

Crates.ioinclude-files
lib.rsinclude-files
version0.1.2
sourcesrc
created_at2022-04-12 09:21:11.010895
updated_at2022-04-12 09:51:54.477906
descriptionImport files bytes into HashMap
homepagehttps://github.com/wyhaya/include-files
repositoryhttps://github.com/wyhaya/include-files.git
max_upload_size
id566336
size5,648
(wyhaya)

documentation

README

include-files

Import files bytes into HashMap

Usage

Cargo.toml:

[dependencies]
once_cell = "1.10.0"

[build-dependencies]
include-files = "*"

build.rs:

fn main() {
    let target = std::env::var("OUT_DIR").unwrap();
    include_files::IncludeFiles::new("./assets", "png", target).build().unwrap();
}

src/example.rs:

// Import build.rs output file
include!(env!("INCLUDE_FILES_PATH"));

for item in INCLUDE_FILES {
    println!("{:?}", item);
}
Commit count: 0

cargo fmt