embark 0.2.2

Embed files into your binary with optional compression and encryption.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! `#[derive(Embed)]` embeds every file under a folder, picking the best
//! codec per file automatically (`codec = "auto"`).

use embark::Embed;

#[derive(Embed)]
#[embark(folder = "examples/assets/")]
#[embark(codec = "auto")]
struct Assets;

fn main() {
    for path in Assets::iter() {
        let file = Assets::get(path).unwrap();
        println!("{} -> {} bytes", path, file.data().len());
    }
}