Macro include_file

Source
macro_rules! include_file {
    ($file:expr) => { ... };
}
Expand description

Places the content of the specified file in the surrounding code unhygienically. i.e. This can be used to inject Rust code into your module.

The file is located relative to the path denoted by the OUT_DIR environment variable at build time.

ยงExamples

#[macro_use] 
extern crate build_script_file_gen;
 
fn main() {
    //hello.rs contains the text: println!("Hello World!");
    //which will make this function print Hello World! when compiled
    include_file!("hello.rs");
}