heappie

See also https://peter-kehl.github.io/embedded_low_level_rust for building and testing no_std/no_std_heap/std libraries on desktop. That also shows any source code included below. —

heappie - summary

Rust macros for ergonomic conditional compilation based on no_std, no_std_heap and std features.

The feature names used/referred-to by these macros are not, and cannot be, configurable. The above three feature names had to be hard-coded. (Explanation of those features is later in this document.)

Conditional compilation and features

TODO include Cargo.toml

Basic conditional feature-based compilation is easy. It can be as simple as using:

TODO EXAMPLE

But if you depend on compound conditions, it gets repetitive. It clutters the code. Hence suggest using macros.

New to Rust? Any identifier following by an exclamation mark ! indicates a macro invocation. (Another type of macros, called attribute macros, start with a hash #.)

TODO EXAMPLE

Features and no_std

Why are no_std and std mutually exclusive?

If your no_std_heap or std code needs extra dependencies, use Features > Optional dependencies.

TODO ranging -> slicing example