{"id":15888061,"url":"https://github.com/lpghatguy/nonmax","last_synced_at":"2025-04-09T16:08:35.099Z","repository":{"id":39611771,"uuid":"299146864","full_name":"LPGhatguy/nonmax","owner":"LPGhatguy","description":"Rust crate that provides number types similar to std's NonZero* types, but that cannot hold a type's maximum value instead.","archived":false,"fork":false,"pushed_at":"2024-01-18T23:58:47.000Z","size":29,"stargazers_count":46,"open_issues_count":4,"forks_count":10,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-09T16:08:15.772Z","etag":null,"topics":["integer","nonmax","nonzero","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LPGhatguy.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-09-28T00:37:10.000Z","updated_at":"2025-02-10T21:49:23.000Z","dependencies_parsed_at":"2024-10-27T23:45:30.315Z","dependency_job_id":"7ca7bca1-7f0b-4a66-802f-9a4a31d82d82","html_url":"https://github.com/LPGhatguy/nonmax","commit_stats":{"total_commits":26,"total_committers":5,"mean_commits":5.2,"dds":"0.42307692307692313","last_synced_commit":"a4a428f67e4da3aa0de285ad95385dddf95aec24"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LPGhatguy%2Fnonmax","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LPGhatguy%2Fnonmax/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LPGhatguy%2Fnonmax/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LPGhatguy%2Fnonmax/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LPGhatguy","download_url":"https://codeload.github.com/LPGhatguy/nonmax/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248065284,"owners_count":21041871,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["integer","nonmax","nonzero","rust"],"created_at":"2024-10-06T06:06:16.131Z","updated_at":"2025-04-09T16:08:35.076Z","avatar_url":"https://github.com/LPGhatguy.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nonmax\n\n[![GitHub CI Status](https://github.com/LPGhatguy/nonmax/workflows/CI/badge.svg)](https://github.com/LPGhatguy/nonmax/actions)\n[![nonmax on crates.io](https://img.shields.io/crates/v/nonmax.svg)](https://crates.io/crates/nonmax)\n[![nonmax docs](https://img.shields.io/badge/docs-docs.rs-orange.svg)](https://docs.rs/nonmax)\n\nnonmax provides types similar to the std `NonZero*` types, but instead requires\nthat their values are not the maximum for their type. This ensures that\n`Option\u003cNonMax*\u003e` is no larger than `NonMax*`.\n\nnonmax supports every type that has a corresponding non-zero variant in the\nstandard library:\n\n* `NonMaxI8`\n* `NonMaxI16`\n* `NonMaxI32`\n* `NonMaxI64`\n* `NonMaxI128`\n* `NonMaxIsize`\n* `NonMaxU8`\n* `NonMaxU16`\n* `NonMaxU32`\n* `NonMaxU64`\n* `NonMaxU128`\n* `NonMaxUsize`\n\n### Example\n\n```rust\nuse nonmax::{NonMaxI16, NonMaxU8};\n\nlet value = NonMaxU8::new(16).expect(\"16 should definitely fit in a u8\");\nassert_eq!(value.get(), 16);\nassert_eq!(std::mem::size_of_val(\u0026value), 1);\n\nlet signed = NonMaxI16::new(i16::min_value()).expect(\"minimum values are fine\");\nassert_eq!(signed.get(), i16::min_value());\nassert_eq!(std::mem::size_of_val(\u0026signed), 2);\n\nlet oops = NonMaxU8::new(255);\nassert_eq!(oops, None);\n```\n\n### Features\n\n* `std` (default): implements [`std::error::Error`] for [`ParseIntError`] and\n[`TryFromIntError`]. Disable this feature for\n[`#![no_std]`](https://rust-embedded.github.io/book/intro/no-std.html) support.\n\n* `serde`: implements the `Serialize` and `Deserialize` traits from [`serde`](https://crates.io/crates/serde).\n\n### Minimum Supported Rust Version (MSRV)\n\nnonmax supports Rust 1.47.0 and newer. Until this library reaches 1.0,\nchanges to the MSRV will require major version bumps. After 1.0, MSRV changes\nwill only require minor version bumps, but will need significant justification.\n\n## License\n\nLicensed under either of\n\n * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)\n * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)\n\nat your option.\n\n### Contribution\nUnless 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.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flpghatguy%2Fnonmax","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flpghatguy%2Fnonmax","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flpghatguy%2Fnonmax/lists"}