boundnum

Crates.ioboundnum
lib.rsboundnum
version0.1.1
sourcesrc
created_at2020-08-28 08:33:35.50178
updated_at2020-08-28 11:02:17.944204
descriptionBounded number type.
homepage
repositoryhttps://github.com/noriapi/boundnum
max_upload_size
id281779
size31,689
(noriapi)

documentation

README

Workflow Status

boundnum

This crate provides a type boundary and a numeric type bounded by it.

Example

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>());
}
Commit count: 36

cargo fmt