Skip to main content

at_least_version

Macro at_least_version 

Source
macro_rules! at_least_version {
    ($($branch:tt)*) => { ... };
}
Available on crate feature unstable only.
Expand description

Selects code based on the esp-hal version.

Branches are considered from top to bottom. The first branch whose version is less than or equal to the current esp-hal version is expanded. The fallback branch is expanded if no version branch matches.

Version branches should be listed in descending order.

ยงExample

use esp_hal::at_least_version;

let description = at_least_version! {
    (2, 0, 0) => { "esp-hal 2.0.0 or newer" }
    (1, 1, 0) => { "esp-hal 1.1.0 or newer" }
    _ => { "an older esp-hal version" }
};