Crates.io | boundnum |
lib.rs | boundnum |
version | 0.1.1 |
source | src |
created_at | 2020-08-28 08:33:35.50178 |
updated_at | 2020-08-28 11:02:17.944204 |
description | Bounded number type. |
homepage | |
repository | https://github.com/noriapi/boundnum |
max_upload_size | |
id | 281779 |
size | 31,689 |
This crate provides a type boundary and a numeric type bounded by it.
use boundnum::{expr::*, typenum::consts::*, Bounded, Boundable};
fn main() {
let less4 = Bounded::<u8, Le<Arg, U4>>::new::<U1>();
let mul_of_two: Bounded<u8, Eq<U0, Rem<Arg, U2>>> =
(*less4 + 3).bound().unwrap_or(Bounded::new::<U0>());
}