Registry / utility / strict-num

strict-num

JSON →
library0.2.0rscratesunverified

A collection of bounded numeric types that enforce constraints at compile and runtime.

# Cargo.toml [dependencies] strict-num = "0.2.0"
INSTALL
IMPORT
SIG · STRICT-NUM
S
strict-num
utilityrustv0.2.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

StrictU8
use strict_num::StrictU8;

Creates a bounded unsigned 8-bit integer and retrieves its value.

use strict_num::StrictU8; fn main() { let val = StrictU8::new(42).unwrap(); println!("{}", val.get()); }
Debug
Known issues
gotchaCreating a StrictNum with an out-of-range value returns an error; unwrap may panic.
fix
Handle the Result properly or use the `new_unchecked` method if you are certain the value is valid.
affects: >=0.1.0
Upgrade
Version history
0.2.0latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
4
Amazon
1
Resources
strict-num — cargo add strict-num · libregistry