pub struct WrappedInterval { /* private fields */ }Expand description
One inclusive interval on the circle of integers modulo 2^64.
References:
- Gange et al., “Interval Analysis and Machine Arithmetic: Why Signedness Ignorance Is Bliss”: https://doi.org/10.1145/2693264
- LLVM’s production
ConstantRangeimplementation: https://llvm.org/doxygen/classllvm_1_1ConstantRange.html
Implementations§
Source§impl WrappedInterval
impl WrappedInterval
pub const fn empty() -> Self
pub const fn full() -> Self
Sourcepub const fn new(low: u64, high: u64) -> Self
pub const fn new(low: u64, high: u64) -> Self
Construct the clockwise arc from low through high, inclusive.
low > high deliberately denotes a wrapping interval.
pub const fn from_value(value: u64) -> Self
pub const fn bounds(&self) -> Option<(u64, u64)>
pub fn is_wrapping(&self) -> bool
pub fn contains_value(&self, value: u64) -> bool
pub fn cardinality(&self) -> u128
Sourcepub fn as_range_set(&self) -> RangeSet<2>
pub fn as_range_set(&self) -> RangeSet<2>
Split at the unsigned zero point. The conversion is exact.
Trait Implementations§
Source§impl Add for WrappedInterval
impl Add for WrappedInterval
Source§impl Clone for WrappedInterval
impl Clone for WrappedInterval
Source§fn clone(&self) -> WrappedInterval
fn clone(&self) -> WrappedInterval
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 WrappedInterval
Source§impl Debug for WrappedInterval
impl Debug for WrappedInterval
Source§impl Default for WrappedInterval
impl Default for WrappedInterval
impl Eq for WrappedInterval
Source§impl PartialEq for WrappedInterval
impl PartialEq for WrappedInterval
impl StructuralPartialEq for WrappedInterval
Auto Trait Implementations§
impl Freeze for WrappedInterval
impl RefUnwindSafe for WrappedInterval
impl Send for WrappedInterval
impl Sync for WrappedInterval
impl Unpin for WrappedInterval
impl UnsafeUnpin for WrappedInterval
impl UnwindSafe for WrappedInterval
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