ranged-num

Crates.ioranged-num
lib.rsranged-num
version0.1.1
sourcesrc
created_at2020-11-25 09:43:58.517791
updated_at2020-11-25 18:27:21.00147
descriptionA package for typing numbers in a compile-time known range
homepage
repositoryhttps://github.com/sheyne/ranged-num/
max_upload_size
id316249
size18,752
Sheyne Anderson (Sheyne)

documentation

README

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);
Commit count: 6

cargo fmt