pub struct URange { /* private fields */ }Expand description
The unsigned strided interval {lo, lo + stride, lo + 2·stride, …, hi} (lo <=u hi, no
wrap-around). The stride is 0 exactly when lo == hi, and otherwise divides hi − lo, so
both bounds are members. A stride of 1 is the plain interval [lo, hi].
Implementations§
Source§impl URange
impl URange
Sourcepub fn new(lo: BitVec, hi: BitVec) -> Option<Self>
pub fn new(lo: BitVec, hi: BitVec) -> Option<Self>
[lo, hi] (stride 1), if the widths match and lo <=u hi.
Sourcepub fn strided(lo: BitVec, hi: BitVec, stride: u64) -> Option<Self>
pub fn strided(lo: BitVec, hi: BitVec, stride: u64) -> Option<Self>
{lo, lo + stride, …, hi}, if the widths match, lo <=u hi, and stride is at least 1
and divides hi − lo (when lo == hi, one value whatever the stride).
Sourcepub fn stride(&self) -> u64
pub fn stride(&self) -> u64
The distance between consecutive members: 0 for one value, 1 for a plain interval.
Sourcepub fn as_constant(&self) -> Option<BitVec>
pub fn as_constant(&self) -> Option<BitVec>
The single value, if the interval has one.
Trait Implementations§
impl Copy for URange
impl Eq for URange
impl StructuralPartialEq for URange
Auto Trait Implementations§
impl Freeze for URange
impl RefUnwindSafe for URange
impl Send for URange
impl Sync for URange
impl Unpin for URange
impl UnsafeUnpin for URange
impl UnwindSafe for URange
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