pub struct Interval {
lo: f64,
hi: f64,
}
Expand description
1D Interval that never wraps around
Represents a minimum and maximum value without wraparound logic (see WraparoundInterval for a wraparound implementation).
Fields§
§lo: f64
Lower bound
hi: f64
Upper bound
Implementations§
Source§impl Interval
impl Interval
Sourcepub fn update_interval(&mut self, other: &Self)
pub fn update_interval(&mut self, other: &Self)
Expand this interval to the union of self and other in place
Note that NaN values are ignored when updating bounds.
Sourcepub fn update_value(&mut self, other: f64)
pub fn update_value(&mut self, other: f64)
Expand this interval to the union of self and other in place
Note that NaN values are ignored when updating bounds.
Trait Implementations§
Source§impl From<Interval> for WraparoundInterval
impl From<Interval> for WraparoundInterval
Source§impl IntervalTrait for Interval
impl IntervalTrait for Interval
Source§fn empty() -> Self
fn empty() -> Self
Create an empty interval that intersects nothing (except the full interval)
Source§fn full() -> Self
fn full() -> Self
Create the full interval (that intersects everything, including the empty interval)
Source§fn is_wraparound(&self) -> bool
fn is_wraparound(&self) -> bool
Check for wraparound Read more
Source§fn intersects_value(&self, value: f64) -> bool
fn intersects_value(&self, value: f64) -> bool
Check for potential intersection with a value Read more
Source§fn intersects_interval(&self, other: &Self) -> bool
fn intersects_interval(&self, other: &Self) -> bool
Check for potential intersection with an interval Read more
Source§fn contains_interval(&self, other: &Self) -> bool
fn contains_interval(&self, other: &Self) -> bool
Check for potential containment of an interval Read more
Source§fn merge_interval(&self, other: &Self) -> Self
fn merge_interval(&self, other: &Self) -> Self
Compute a new interval that is the union of both Read more
Source§fn merge_value(&self, other: f64) -> Self
fn merge_value(&self, other: f64) -> Self
Compute a new interval that is the union of both Read more
Source§impl TryFrom<WraparoundInterval> for Interval
impl TryFrom<WraparoundInterval> for Interval
impl Copy for Interval
impl StructuralPartialEq for Interval
Auto Trait Implementations§
impl Freeze for Interval
impl RefUnwindSafe for Interval
impl Send for Interval
impl Sync for Interval
impl Unpin for Interval
impl UnwindSafe for Interval
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