pub fn write_byte_arrays(
struct_output_path: &Path,
struct_name: &str,
byte_arrays: Vec<(&str, Bytes)>,
) -> Result<()>Expand description
Writes binary files to OUT_DIR/embed/ and generates a Rust struct in src/.
- Binary files are written to
OUT_DIR/embed/. - The generated
.rsfile is placed atsrc/<struct_name>.rs.
If the embed-bytes feature is enabled, the struct contains constants
referencing the binary files using include_bytes!. Otherwise, they are
empty arrays with a deprecation warning.
§Arguments
struct_output_path- The path tosrc/<struct_name>.rs.struct_name- The name of the generated struct.byte_arrays- A vector of tuples(field_name, content), wherefield_nameis the associated constant andcontentis the binary.
§Errors
Returns an io::Error if any file operation fails.