Skip to main content

Module bounded

Module bounded 

Source
Expand description

A clamped f32 newtype, generic over its bounds. Bounded<B> can only hold values in [B::MIN, B::MAX]: the constructor clamps, every arithmetic op re-clamps, and NaN collapses to B::MIN — so the type is totally ordered and Eq/Ord are sound.

Structs§

Bounded
OutOfBounds
A value outside a Bounded’s interval, or NaN, offered where one is read rather than made — refused there instead of clamped, since it did not come from this type.

Traits§

Bounds
The closed interval a Bounded value lives in. Implemented by empty marker types (ProgressBounds, ZoomBounds, …).