pub struct VolumeInterval { /* private fields */ }Expand description
Bounds on a volume in cubic metres: finite, non-negative, and sure to contain the true value.
Implementations§
Source§impl VolumeInterval
impl VolumeInterval
Sourcepub fn try_new(
lower_cubic_metres: f64,
upper_cubic_metres: f64,
) -> Result<Self, ProximityError>
pub fn try_new( lower_cubic_metres: f64, upper_cubic_metres: f64, ) -> Result<Self, ProximityError>
Validates inclusive lower and upper bounds.
Sourcepub fn exact(cubic_metres: f64) -> Result<Self, ProximityError>
pub fn exact(cubic_metres: f64) -> Result<Self, ProximityError>
A volume known exactly.
pub fn lower_cubic_metres(&self) -> f64
pub fn upper_cubic_metres(&self) -> f64
(lower, upper) bounds on this volume’s share of whole, for a
part that lies within the whole: outward rounded and clamped to
[0, 1], so the true share always lies inside.
Trait Implementations§
Source§impl Clone for VolumeInterval
impl Clone for VolumeInterval
impl Copy for VolumeInterval
Source§impl Debug for VolumeInterval
impl Debug for VolumeInterval
Source§impl PartialEq for VolumeInterval
impl PartialEq for VolumeInterval
impl StructuralPartialEq for VolumeInterval
Auto Trait Implementations§
impl Freeze for VolumeInterval
impl RefUnwindSafe for VolumeInterval
impl Send for VolumeInterval
impl Sync for VolumeInterval
impl Unpin for VolumeInterval
impl UnsafeUnpin for VolumeInterval
impl UnwindSafe for VolumeInterval
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more