numX Build Status Crates.io

Non standard integer types like u122, u9, i67, u10, u63, i7, i9 etc

rust struct Packet { header: u3, timestamp: u5, hash: u4, mode: u2, }

This is a fork of uX by kjetilkjeka

I have merely merged the pull requests on this fork and added features what would otherwise have been my pull request to him.

I am still a rust beginner. Examine this yourself before deciding to use it!

Features

When non-standard-width integers is required in an application, the norm is to use a larger container and make sure the value is within range after manipulation. numX aims to take care of this once and for all by: - Providing u1-u127 and i1-i127 types that should behave as similar as possible to the built in rust types - The methods of the defined types are the same as for the built in types (far from all is implemented at this point but fill out an issue or create a PR if something essential for you is missing) - Overflow will panic in debug and wrap in release. - All possible lossless conversions are possible by using From. - All possible lossy conversions are possible by using TryFrom. - Support for serde by serializing into the next bigger container. - All possible conversions to isize and usize for the target architecture. - Implementations of some num-traits.

Thanks

Thank to all the contributors from the original project and to the people who sent the pull requests that I merged: - adamnemecek - Atul Bhosale - Kevin Boos - Angelo Bulfone - meh

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.