foundationdb_macros

Attribute Macro cfg_api_versions

source
#[cfg_api_versions]
Expand description

Allow to compute the range of supported api versions for a functionality.

This macro came out from the frustration of bumping fdb’s version, where we are spending most of our time searching for things like: #[cfg(any(feature = "fdb-5_1", feature = "fdb-5_2", feature = "fdb-6_0"))] and adding the new version manually.

Thanks to the macro, we can now specify a minimum and an optional max version, and generate the right list of any. Not specifying a max allow easy bump to a new version.

#[cfg_api_versions(min = 510, max = 600)] will be translated to: #[cfg(any(feature = "fdb-5_1", feature = "fdb-5_2", feature = "fdb-6_0"))]