Struct sanitizer::IntSanitizer [−][src]
pub struct IntSanitizer<T: PartialOrd + Copy>(_);
Expand description
The IntSanitizer structure is a wrapper over a type T which is to
be sanitized, T can be anything that’s PartialOrd
Example
use sanitizer::prelude::*;
let mut instance = IntSanitizer::from(5);
instance
.clamp(9, 15);
assert_eq!(instance.get(), 9);
Implementations
Sets the int equal to the max value if it exceds the provided max value provided in the function argument