Crate std_detect
source ·🔬This is a nightly-only experimental API. (
stdsimd)Expand description
Run-time feature detection for the Rust standard library.
To detect whether a feature is enabled in the system running the binary use one of the appropriate macro for the target:
x86andx86_64:is_x86_feature_detectedarm:is_arm_feature_detectedaarch64:is_aarch64_feature_detectedriscv:is_riscv_feature_detectedmips:is_mips_feature_detectedmips64:is_mips64_feature_detectedpowerpc:is_powerpc_feature_detectedpowerpc64:is_powerpc64_feature_detected
Modules
- detectExperimentalThis module implements run-time feature detection.
 
Macros
- detect_featureExperimental
 - Checks if
armfeature is enabled. - Checks if
mips64feature is enabled. - Checks if
mipsfeature is enabled. - Checks if
powerpcfeature is enabled. - Checks if
powerpcfeature is enabled. - A macro to test at runtime whether instruction sets are available on RISC-V platforms.
 - is_aarch64_feature_detectedAArch64This macro tests, at runtime, whether an
aarch64feature is enabled on aarch64 platforms. Currently most features are only supported on linux-based platforms. - is_x86_feature_detectedx86 or x86-64A macro to test at runtime whether a CPU feature is available on x86/x86-64 platforms.