Skip to main content

Embed

Derive Macro Embed 

Source
#[derive(Embed)]
{
    // Attributes available to this derive:
    #[embed]
}
Expand description

Derive the Embed trait for unit struct, embedding assets from a folder.

ยงUsage

Apply #[derive(Embed)] to a unit struct and specify the folder to embed using the #[embed(folder = "...")] attribute.

Optionally, specify the crate path with #[embed(crate = path)]. This is applicable when invoking re-exported derive from a public macro in a different crate.