Skip to main content

Crate use_hardness

Crate use_hardness 

Source
Expand description

Primitive hardness helpers.

Hardness values are only compared when they share the same scale. No approximate cross-scale conversions are provided in this first pass.

§Examples

use use_hardness::{Hardness, HardnessScale, is_harder_than, same_scale};

let first = Hardness::new(200.0, HardnessScale::Vickers).unwrap();
let second = Hardness::new(180.0, HardnessScale::Vickers).unwrap();

assert!(same_scale(first, second));
assert!(is_harder_than(first, second).unwrap());

Structs§

Hardness

Enums§

HardnessError
HardnessScale

Functions§

is_harder_than
same_scale