Crate notstd_detect
source ·🔬This is a nightly-only experimental API. (
stdarch_internal
)Expand description
notstd_detect
is a fork of std_detect
: the 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:
x86
andx86_64
:is_x86_feature_detected
arm
:is_arm_feature_detected
aarch64
:is_aarch64_feature_detected
riscv
:is_riscv_feature_detected
mips
:is_mips_feature_detected
mips64
:is_mips64_feature_detected
powerpc
:is_powerpc_feature_detected
powerpc64
:is_powerpc64_feature_detected
loongarch
:is_loongarch_feature_detected
Macros§
- is_aarch64_feature_detectedAArch64This macro tests, at runtime, whether an
aarch64
feature is enabled on aarch64 platforms. Currently most features are only supported on linux-based platforms. - is_riscv_feature_detectedRISC-V RV32 or RISC-V RV64A macro to test at runtime whether instruction sets are available on RISC-V platforms.
- is_x86_feature_detectedx86 or x86-64A macro to test at runtime whether a CPU feature is available on x86/x86-64 platforms.
- detect_featureExperimental
- Checks if
arm
feature is enabled. - Checks if
loongarch
feature is enabled. Supported arguments are: - Checks if
mips64
feature is enabled. - Checks if
mips
feature is enabled. - Checks if
powerpc
feature is enabled. - Checks if
powerpc
feature is enabled.