Skip to main content

embed_static

Macro embed_static 

Source
embed_static!() { /* proc-macro */ }
Expand description

Compile a static directory into the binary as a rustango::static_files::EmbeddedDir. The path is relative to the crate’s Cargo.toml; names starting with . are left out.

static ASSETS: rustango::static_files::EmbeddedDir = rustango::embed_static!("static");

Edits to embedded files rebuild the crate; a new file needs a build.rs with println!("cargo:rerun-if-changed=static");.