encrust_file_bytes!() { /* proc-macro */ }
Available on crate feature macros only.
Expand description

Read the contents of a file into a u8 array and encrust it so the actual file contents is encrypted before being included in the binary.

Unless an absolute path is given, the file is read relative to the CARGO_MANIFEST_DIR variable, which is set to the directory containing the crate’s Cargo.toml file. Note that this is not identical to include_bytes!’s behavior, which reads relative to the file using the macro.

Example

let mut cargo_toml = encrust_file_bytes!("Cargo.toml");