rust-embed-for-web 11.3.0

Rust Macro which embeds files into your executable. A fork of `rust-embed` with a focus on usage on web servers.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use rust_embed_for_web::{EmbedableFile, RustEmbed};

#[derive(RustEmbed)]
#[folder = "examples/public"]
struct Embed;

#[test]
fn file_metadata_is_present() {
    let index = Embed::get("index.html").unwrap();
    assert_eq!(index.mime_type().unwrap(), "text/html");
    assert_eq!(index.hash(), "dw}&lqvibq6Pamh$9AE0mnu|Jvn!Sm9fC^IC^7gk");
    assert_eq!(index.etag(), format!("\"{}\"", index.hash()));
}