directorate

Crates.iodirectorate
lib.rsdirectorate
version0.0.4
sourcesrc
created_at2024-11-02 12:28:41.083874
updated_at2024-11-02 22:04:07.277059
descriptionA object wrapper of rust_embed that lets you treat your embeded data as a ownerable object type
homepage
repositoryhttps://github.com/ewe-studios/ewe_platform
max_upload_size
id1432827
size7,095
Ewetumo Alexander (influx6)

documentation

README

Directorate

Build Status crates.io docs.rs

Provides a small but usable wrapper for the rust_embed crate, sometimes you want to use the rust Embed implement struct as an object you can clone and pass around but the rust_embed Embed interface has all it's method as non-attached (they do not use self) so you cant really use them as an object you can pass around (I assume for performance reasons).

The directorate crate exists to attempt to provide a way to do so:

use directorate::Directorate;

#[derive(rust_embed::Embed, Default)]
#[folder = "test_directory/"]
struct Directory;

let generator = Directorate::<Directory>::default();
let readme_file = generator.get_file("README.md");

Commit count: 237

cargo fmt