๐ฌThis is a nightly-only experimental API. (
stdarch_internal
)Expand description
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
Feature
enum, - call a
os::check_for(x: Feature)
function that returnstrue
if 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.
Re-exportsยง
#[doc(hidden)] pub use self::arch::__is_feature_detected;
Experimental
Modulesยง
- arch ๐
Experimental - bit ๐
Experimental - Bit manipulation utilities.
- cache ๐
Experimental - Caches run-time feature detection so that it only needs to be computed once.
- macros ๐
Experimental - os ๐
Experimental - x86 run-time feature detection is OS independent.