#[non_exhaustive]pub struct DistanceInterval {
pub lower: f64,
pub upper: f64,
}Expand description
A distance certified to lie in [lower, upper]: what
CurveEvaluator::path_joint_distances
returns for each joint of a curve path.
The bounds are a proof, not an estimate: the true value lies between
them. A distance read from stored data alone (a line’s, a circle’s, a
sum of stored lengths) is a point interval, lower == upper.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.lower: f64The largest value the distance is certified not to be below.
upper: f64The smallest value the distance is certified not to exceed.
Implementations§
Source§impl DistanceInterval
impl DistanceInterval
Sourcepub const fn new(lower: f64, upper: f64) -> DistanceInterval
pub const fn new(lower: f64, upper: f64) -> DistanceInterval
The interval [lower, upper]. Nothing is checked here; a provider
returns lower <= upper, both finite.
Sourcepub const fn point(value: f64) -> DistanceInterval
pub const fn point(value: f64) -> DistanceInterval
The point interval [value, value]: a distance known exactly.
Sourcepub fn meets(&self, other: &DistanceInterval) -> bool
pub fn meets(&self, other: &DistanceInterval) -> bool
Whether the two intervals share a point, their ends included:
whether a distance certified to self can lie in other (#305).
Trait Implementations§
Source§impl Clone for DistanceInterval
impl Clone for DistanceInterval
Source§fn clone(&self) -> DistanceInterval
fn clone(&self) -> DistanceInterval
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 DistanceInterval
Source§impl Debug for DistanceInterval
impl Debug for DistanceInterval
Source§impl PartialEq for DistanceInterval
impl PartialEq for DistanceInterval
impl StructuralPartialEq for DistanceInterval
Auto Trait Implementations§
impl Freeze for DistanceInterval
impl RefUnwindSafe for DistanceInterval
impl Send for DistanceInterval
impl Sync for DistanceInterval
impl Unpin for DistanceInterval
impl UnsafeUnpin for DistanceInterval
impl UnwindSafe for DistanceInterval
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