pub struct CanonicalValueRange { /* private fields */ }Expand description
An exact-domain, non-empty canonical value range.
Implementations§
Source§impl CanonicalValueRange
impl CanonicalValueRange
Sourcepub fn new(
lower: Option<CanonicalValue>,
upper: Option<CanonicalValue>,
) -> Result<Self, Diagnostic>
pub fn new( lower: Option<CanonicalValue>, upper: Option<CanonicalValue>, ) -> Result<Self, Diagnostic>
Validate a range with at least one bound and one exact scalar domain.
Sourcepub fn new_detailed(
lower: Option<CanonicalValue>,
upper: Option<CanonicalValue>,
) -> Result<Self, CanonicalValueRangeViolation>
pub fn new_detailed( lower: Option<CanonicalValue>, upper: Option<CanonicalValue>, ) -> Result<Self, CanonicalValueRangeViolation>
Validate bounds while retaining the exact failure for source diagnostics.
Sourcepub const fn lower(&self) -> Option<&CanonicalValue>
pub const fn lower(&self) -> Option<&CanonicalValue>
Return the lower bound.
Sourcepub const fn upper(&self) -> Option<&CanonicalValue>
pub const fn upper(&self) -> Option<&CanonicalValue>
Return the upper bound.
Trait Implementations§
Source§impl Clone for CanonicalValueRange
impl Clone for CanonicalValueRange
Source§fn clone(&self) -> CanonicalValueRange
fn clone(&self) -> CanonicalValueRange
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 moreSource§impl Debug for CanonicalValueRange
impl Debug for CanonicalValueRange
impl Eq for CanonicalValueRange
Source§impl Ord for CanonicalValueRange
impl Ord for CanonicalValueRange
Source§fn cmp(&self, other: &CanonicalValueRange) -> Ordering
fn cmp(&self, other: &CanonicalValueRange) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for CanonicalValueRange
impl PartialEq for CanonicalValueRange
Source§impl PartialOrd for CanonicalValueRange
impl PartialOrd for CanonicalValueRange
Source§impl Serialize for CanonicalValueRange
impl Serialize for CanonicalValueRange
impl StructuralPartialEq for CanonicalValueRange
Auto Trait Implementations§
impl Freeze for CanonicalValueRange
impl RefUnwindSafe for CanonicalValueRange
impl Send for CanonicalValueRange
impl Sync for CanonicalValueRange
impl Unpin for CanonicalValueRange
impl UnsafeUnpin for CanonicalValueRange
impl UnwindSafe for CanonicalValueRange
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