Crates.io | ranged_type |
lib.rs | ranged_type |
version | 0.1.0 |
source | src |
created_at | 2021-01-31 05:08:14.073012 |
updated_at | 2021-01-31 05:08:14.073012 |
description | An crate providing ranged numeric types. |
homepage | |
repository | https://github.com/u007d/ranged_type |
max_upload_size | |
id | 348765 |
size | 48,090 |
An (early-stage) crate providing ranged numeric types.
Ranged types are a great way to leverage the type system to provide more expressive typestate. It's a good rule of thumb to prefer compile-time errors over runtime errors.
Ranged types in this crate are designed such that arithmetic of two ranged types is a zero runtime overhead (ZRO) operation.
const
. May be possible in the future to relax this to also permit runtime
values as well (such values would no longer benefit from ZRO arithmetic operations, of course).const
arithmetic on rustc nightly-2020-06-04
.Licensed under either:
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you shall be dual licensed as above, without any additional terms or conditions.