Module detect
This module implements run-time feature detection.
The is_{arch}_feature_detected!("feature-name") macros take the name of a
feature as a string-literal, and return a boolean indicating whether the
feature is enabled at run-time or not.
These macros do two things:
- map the string-literal into an integer stored as a
Featureenum, - call a
os::check_for(x: Feature)function that returnstrueif the feature is enabled.
The Feature enums are also implemented in the arch/{target_arch}.rs
modules.
The check_for functions are, in general, Operating System dependent. Most
architectures do not allow user-space programs to query the feature bits
due to security concerns (x86 is the big exception). These functions are
implemented in the os/{target_os}.rs modules.