macro_rules! include_str { ($file:expr $(,)?) => { ... };}
Expand description
Includes a UTF-8 encoded file as a string.
The file is located relative to the current file (similarly to howmodules are found). The provided path is interpreted in a platform-specificway at compile time. So, for instance, an invocation with a Windows pathcontaining backslashes\
would not compile correctly on Unix.
This macro will yield an expression of type&'static str
which is thecontents of the file.
§Examples
Assume there are two files in the same directory with the followingcontents:
File ‘spanish.in’:
adiós
File ‘main.rs’:
Compiling ‘main.rs’ and running the resulting binary will print “adiós”.