Useful Rust Macros

#[rustfmt::skip] // below won't be formatted by rustfmt

println! // Variables can be specified (both ways work)
println!("{yourvar}")
println!("{}",yourvar)

stringify!(1+1) // "1+1"  &'static str

// https://doc.rust-lang.org/std/macro.column.html
column! // "Expands to the column number at which it was invoked."

// https://doc.rust-lang.org/std/macro.line.html
line! // "Expands to the line number on which it was invoked."

// https://doc.rust-lang.org/std/macro.file.html
file! // "Expands to the file name in which it was invoked."

// https://doc.rust-lang.org/std/macro.module_path.html
module_path! // "Expands to a string that represents the current module path."

// https://doc.rust-lang.org/std/macro.include_bytes.html
include_bytes! // "Includes a file as a reference to a byte array."

json! // serde_json::json

todo!
unimplemented!

Lazy Static lazy_static!

[dependencies]
lazy_static = "0.2.8"
If you found it valuable, please join to the nexss.com supporters at: Support Nexss.com