pub struct RangeValue {
pub lower: Option<f64>,
pub upper: Option<f64>,
}Expand description
Range value for numeric ranges (lower and upper bounds, both optional).
Used in Value::VRange to represent numeric ranges with optional bounds.
Note: This type only implements PartialEq, not Eq, because f64 doesn’t implement Eq
(due to NaN != NaN).
§Examples
use pattern_core::RangeValue;
// Closed range: 1.0 to 10.0
let range1 = RangeValue {
lower: Some(1.0),
upper: Some(10.0),
};
// Lower bound only: 1.0 to infinity
let range2 = RangeValue {
lower: Some(1.0),
upper: None,
};
// Upper bound only: negative infinity to 10.0
let range3 = RangeValue {
lower: None,
upper: Some(10.0),
};Fields§
§lower: Option<f64>Lower bound of the range (inclusive), None means unbounded below
upper: Option<f64>Upper bound of the range (inclusive), None means unbounded above
Trait Implementations§
Source§impl Clone for RangeValue
impl Clone for RangeValue
Source§fn clone(&self) -> RangeValue
fn clone(&self) -> RangeValue
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RangeValue
impl Debug for RangeValue
Source§impl Display for RangeValue
impl Display for RangeValue
Source§impl PartialEq for RangeValue
impl PartialEq for RangeValue
impl StructuralPartialEq for RangeValue
Auto Trait Implementations§
impl Freeze for RangeValue
impl RefUnwindSafe for RangeValue
impl Send for RangeValue
impl Sync for RangeValue
impl Unpin for RangeValue
impl UnsafeUnpin for RangeValue
impl UnwindSafe for RangeValue
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