Crates.io | embeddy-derive |
lib.rs | embeddy-derive |
version | 0.1.0 |
source | src |
created_at | 2023-04-28 22:54:36.814028 |
updated_at | 2023-04-28 22:54:36.814028 |
description | Resource embedding derive macro |
homepage | |
repository | https://github.com/jacobtread/embeddy |
max_upload_size | |
id | 851744 |
size | 4,735 |
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");
}