Macro static_assets::asset_bytes [−][src]
macro_rules! asset_bytes { ($filename: tt) => { ... }; }
Load a binary asset statically in release mode, or dynamically in debug.
The filename is relative to the root of your crate.
If you wish to override the static/dynamic behaviour, you can use the force-static
or force-dynamic
features.
Panics
When running in debug mode, this will panic if the file does not exist. In release mode, this will be a compile error and will never panic.
Examples
ⓘThis example is not tested
let toml_bytes = asset_bytes!("Cargo.toml"); println!("{:?}", toml_bytes);