Skip to main content

code

Macro code 

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

Compile-time syntax highlighting.

Reads a source file relative to the consumer’s CARGO_MANIFEST_DIR, parses it with [arborium], and expands to the resulting span tree. Pass the path as a string literal, concat!(...), or env!(...). Pass CodeOptions::builder with CodeOptions::with_language to name the language explicitly; otherwise it is inferred from the file extension.