0.5.5 - This version may not be safe as it has not been updated for a long time. Find out if your coding project uses this component and get notified of any reported security vulnerabilities with Meterian-X Open Source Security Platform
Maintain your licence declarations and avoid unwanted licences to protect your IP the way you intended.
MIT - MIT Licensenonmax provides types similar to the std NonZero* types, but instead requires
that their values are not the maximum for their type. This ensures that
Option<NonMax*> is no larger than NonMax*.
nonmax supports every type that has a corresponding non-zero variant in the standard library:
NonMaxI8NonMaxI16NonMaxI32NonMaxI64NonMaxI128NonMaxIsizeNonMaxU8NonMaxU16NonMaxU32NonMaxU64NonMaxU128NonMaxUsizeuse nonmax::{NonMaxI16, NonMaxU8};
let value = NonMaxU8::new(16).expect("16 should definitely fit in a u8");
assert_eq!(value.get(), 16);
assert_eq!(std::mem::size_of_val(&value), 1);
let signed = NonMaxI16::new(i16::min_value()).expect("minimum values are fine");
assert_eq!(signed.get(), i16::min_value());
assert_eq!(std::mem::size_of_val(&signed), 2);
let oops = NonMaxU8::new(255);
assert_eq!(oops, None);std (default): implements [std::error::Error] for [ParseIntError] and
[TryFromIntError]. Disable this feature for
#![no_std] support.
serde: implements the Serialize and Deserialize traits from serde.
nonmax supports Rust 1.83.0 and newer. Until this library reaches 1.0, changes to the MSRV will require major version bumps. After 1.0, MSRV changes will only require minor version bumps, but will need significant justification.
Licensed under either of
at your option.
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.