Skip to main content

Module macros

Module macros 

Source
Expand description

14 utility macros for assertions, collections, range-checks, and string operations. Available in no_std. Utility macros that eliminate common Rust boilerplate.

Macros marked no_std work without the std feature. Macros marked std require the std feature.

§Available macros

MacroRequiresDescription
cmn_assertno_stdChecks if the given expression is true.
cmn_containsno_stdChecks if the given string contains the given substring.
cmn_in_rangeno_stdChecks if the given value is in the given range.
cmn_maxno_stdReturns the maximum of the given values.
cmn_minno_stdReturns the minimum of the given values.
cmn_to_numno_stdConverts the given string to a number.
cmn_constantsno_stdDefines a set of f64 constants.
cmnstdParses arguments via Common::parse.
cmn_parsestdParses the given input into a Rust value.
cmn_joinstdJoins strings together.
cmn_splitstdSplits a string into a vector of words.
cmn_vecstdCreates a new vector with the given elements.
cmn_mapstdCreates a new map of the given key-value pairs.
cmn_printstdPrints the arguments to the console.
cmn_print_vecstdPrints a vector of elements to the console.