pub struct RangeConstraint { /* private fields */ }Expand description
A numeric range with independently inclusive, exclusive, or absent bounds.
Implementations§
Source§impl RangeConstraint
impl RangeConstraint
Sourcepub fn new(lower: ArgumentBound, upper: ArgumentBound) -> Self
pub fn new(lower: ArgumentBound, upper: ArgumentBound) -> Self
Creates a range from its lower and upper bounds.
The bounds are retained exactly as supplied and are not ordered or otherwise validated.
Sourcepub fn lower(&self) -> &ArgumentBound
pub fn lower(&self) -> &ArgumentBound
Returns the lower bound of this range.
Sourcepub fn upper(&self) -> &ArgumentBound
pub fn upper(&self) -> &ArgumentBound
Returns the upper bound of this range.
Sourcepub fn into_bounds(self) -> (ArgumentBound, ArgumentBound)
pub fn into_bounds(self) -> (ArgumentBound, ArgumentBound)
Consumes this range and returns its lower and upper bounds.
The first tuple element is the lower bound and the second is the upper bound.
Trait Implementations§
Source§impl Clone for RangeConstraint
impl Clone for RangeConstraint
Source§fn clone(&self) -> RangeConstraint
fn clone(&self) -> RangeConstraint
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 RangeConstraint
impl Debug for RangeConstraint
impl Eq for RangeConstraint
Source§impl PartialEq for RangeConstraint
impl PartialEq for RangeConstraint
impl StructuralPartialEq for RangeConstraint
Auto Trait Implementations§
impl Freeze for RangeConstraint
impl RefUnwindSafe for RangeConstraint
impl Send for RangeConstraint
impl Sync for RangeConstraint
impl Unpin for RangeConstraint
impl UnsafeUnpin for RangeConstraint
impl UnwindSafe for RangeConstraint
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