pub enum Constraint {
Empty {
bits: usize,
},
Unsigned {
from: u64,
to: u64,
bits: usize,
},
Signed {
from: i64,
to: i64,
bits: usize,
},
Full {
bits: usize,
},
}Expand description
A range of n-bit integers.
Variants§
Empty
The empty range containing no values.
Unsigned
A range from-to, both inclusive.
Fields
Signed
A range from-to, both inclusive.
Fields
Full
A range containing all bits long integer.
Implementations§
Source§impl Constraint
impl Constraint
Sourcepub fn new(bits: usize) -> Result<Constraint>
pub fn new(bits: usize) -> Result<Constraint>
Creates a new full ranges, bits large.
Sourcepub fn clamp_lower_bound_unsigned(&mut self, bound: u64)
pub fn clamp_lower_bound_unsigned(&mut self, bound: u64)
Sets the lower bound to the unsigned value bound (inclusive).
Sourcepub fn clamp_lower_bound_signed(&mut self, bound: u64)
pub fn clamp_lower_bound_signed(&mut self, bound: u64)
Sets the lower bound to the signed value bound (inclusive).
Sourcepub fn clamp_upper_bound_unsigned(&mut self, bound: u64)
pub fn clamp_upper_bound_unsigned(&mut self, bound: u64)
Sets the upper bound to the unsigned value bound (inclusive).
Sourcepub fn clamp_upper_bound_signed(&mut self, bound: u64)
pub fn clamp_upper_bound_signed(&mut self, bound: u64)
Sets the upper bound to the signed value bound (inclusive).
Sourcepub fn union_with(&mut self, other: Self)
pub fn union_with(&mut self, other: Self)
Extends the range to include all values in other.
Sourcepub fn intersect_with(&mut self, other: Self)
pub fn intersect_with(&mut self, other: Self)
Limits this range to the values in other.
Sourcepub fn limit(&self, v: Value) -> Value
pub fn limit(&self, v: Value) -> Value
Apply this range to v, returning either v itself of Undefined if it is outside.
Trait Implementations§
Source§impl Arbitrary for Constraint
impl Arbitrary for Constraint
Source§impl Clone for Constraint
impl Clone for Constraint
Source§fn clone(&self) -> Constraint
fn clone(&self) -> Constraint
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 Constraint
impl Debug for Constraint
Source§impl PartialEq for Constraint
impl PartialEq for Constraint
impl Eq for Constraint
impl StructuralPartialEq for Constraint
Auto Trait Implementations§
impl Freeze for Constraint
impl RefUnwindSafe for Constraint
impl Send for Constraint
impl Sync for Constraint
impl Unpin for Constraint
impl UnwindSafe for Constraint
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.