Expand description
§mac
A collection of great and ubiqutitous macros.
Modules§
- cfg
- Macros for conditional compilation.
- format
- Macros for string formatting.
- inspect
- Inspect Macros
- matches
- Pattern Matching macros.
- mem
- Macros for low-level memory manipulation.
- syntax_
ext - Macros useful when writing procedural syntax extensions.
- test
- Macros for writing test suites.
Macros§
- addrs_
of - Make a tuple of the addresses of some of a struct’s fields.
- do_
while - Do-while loop.
- ext_
bail - Call
span_err
on anExtCtxt
and returnDummyResult::any
. - ext_
bail_ if ext_bail!
if the condition$e
is true.- ext_
expect - Unwrap the
Option
$e
, orext_bail!
. - format_
if - Conditionally perform string formatting.
- if_cfg
- Compile-time conditional expression.
- inspect
- Evaluates an expression, prints a stringified version of the expression along with the evaluated value, and then returns that value.
- match_
cfg - Compile-time matching on config variables.
- matches
- Returns true if an expression matches a pattern.
- test_eq
- Generate a test function
$name
which asserts that$left
and$right
are equal. - unwrap_
or_ return - Unwraps an
Option
or returns from the function with the specified return value.