A page of a nice interactive course about Ada explains in a small space the basics of intervals and sub-types:
https://learn.adacore.com/courses/intro-to-ada/chapters/strongly_typed_language.html
This page shows some things that I don’t like, or are probably excessive, but the overall idea seems interesting for Rust too.