Let’s use the Pin.
In Rust, pin is a property that prevents the memory location of an object from being relocated. The most common case where this feature…
pin
Rust has a good language feature supporting the compile-time evaluation of function.
It is const fn.
const fn
At the time this post is written this feature is not in a state of stabilized, but you can use it using Nightly Rust compiler.
C++ users can write codes like this way.