pub struct LinearInterval { /* private fields */ }Expand description
A measured length, in metres, bounded below and above.
Implementations§
Source§impl LinearInterval
impl LinearInterval
Sourcepub fn try_new(lower: f64, upper: f64) -> Result<Self, LinearQuantityError>
pub fn try_new(lower: f64, upper: f64) -> Result<Self, LinearQuantityError>
Bounds for an approximate measurement.
Sourcepub fn exact(metres: f64) -> Result<Self, LinearQuantityError>
pub fn exact(metres: f64) -> Result<Self, LinearQuantityError>
A measurement the adapter can vouch for exactly.
pub fn lower_metres(&self) -> f64
pub fn upper_metres(&self) -> f64
Sourcepub fn is_exact(&self) -> bool
pub fn is_exact(&self) -> bool
True when the interval collapses to a single value.
Exact bit-equality is the intended test: the bounds are only equal when
an adapter constructed them from one measurement via Self::exact.
A tolerance here would let a genuine range masquerade as exact.
Sourcepub fn definitely_at_least(&self, minimum: f64) -> bool
pub fn definitely_at_least(&self, minimum: f64) -> bool
Whether the whole interval clears minimum.
Comparison lives with the caller, but the interval semantics live here: a partially-clearing interval is not a pass, and saying so once stops each capability inventing its own rounding.
Sourcepub fn definitely_below(&self, minimum: f64) -> bool
pub fn definitely_below(&self, minimum: f64) -> bool
Whether no part of the interval clears minimum.
Trait Implementations§
Source§impl Clone for LinearInterval
impl Clone for LinearInterval
Source§fn clone(&self) -> LinearInterval
fn clone(&self) -> LinearInterval
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for LinearInterval
Source§impl Debug for LinearInterval
impl Debug for LinearInterval
Source§impl PartialEq for LinearInterval
impl PartialEq for LinearInterval
impl StructuralPartialEq for LinearInterval
Auto Trait Implementations§
impl Freeze for LinearInterval
impl RefUnwindSafe for LinearInterval
impl Send for LinearInterval
impl Sync for LinearInterval
impl Unpin for LinearInterval
impl UnsafeUnpin for LinearInterval
impl UnwindSafe for LinearInterval
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