#generic #struct #bounds #clamp #restricted

clamped_values

Provides a generic ClampedValue struct that stores a value and ensures that it is always within the specified minimum and maximum values

1 unstable release

0.1.0 Jan 6, 2024

#2547 in Rust patterns

MIT/Apache

12KB
180 lines

Usage

Add the following to your Cargo.toml

[dependencies]
clamped_values = "0.1.0"

lib.rs:

Provides a generic ClampedValue struct that stores a value and ensures that it is always within the specified minimum and maximum values.

Dependencies

~155KB