What is the idiomatic way to achieve ranged integers in Rust?
3 July 2022 at 09:11
In the Ada programming language, one can use the range constraint to declare that the value of a signed integer has to be within a minimum and maximum. An exception is triggered if not, for example.
What is the idiomatic way to achieve this in Rust?