Crates.io | embeddy |
lib.rs | embeddy |
version | 0.1.1 |
source | src |
created_at | 2023-04-25 05:26:47.850571 |
updated_at | 2023-04-28 22:54:53.313599 |
description | Resource embedding |
homepage | |
repository | https://github.com/jacobtread/embeddy |
max_upload_size | |
id | 848237 |
size | 4,369 |
Minimal opinionated resource embedding
Files are loaded relative to the Cargo.toml file
use embeddy::Embedded;
/// Contains all the files stored in the "test" folder
/// use the [`Embedded::get`] method to access the folders
#[derive(Embedded)]
#[folder = "test"]
struct MyResources;
fn main() {
let file: Option<&'static [u8]> = MyResources::get("test.txt");
let nested_file: Option<&'static [u8]> = MyResources::get("sub/test.txt");
}