ranged-num 0.1.1

A package for typing numbers in a compile-time known range
Documentation
  • Coverage
  • 93.75%
    15 out of 16 items documented13 out of 14 items with examples
  • Size
  • Source code size: 18.6 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 4.22 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 12s Average build duration of successful builds.
  • all releases: 12s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Sheyne/ranged-num
    2 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • Sheyne

ranged-num is a crate for representing a single number that is in some compile-time known range of values. You can use any underlying numeric type to hold the actual value. The main type to look at is Ranged.

Example:

use typenum::{N2, P3, P4};
use ranged_num::Ranged;

let ranged = Ranged::<N2, P4, isize>::new::<P3>();
assert_eq!(ranged.value(), 3);