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

Fields

bits: usize

Bitsize of the integer this range constraints.

The empty range containing no values.

Unsigned

Fields

from: u64

Lower bound (inclusive).

to: u64

Upper bound (inclusive).

bits: usize

Bitsize of the integer this range constraints.

A range from-to, both inclusive.

Signed

Fields

from: i64

Lower bound (inclusive).

to: i64

Upper bound (inclusive).

bits: usize

Bitsize of the integer this range constraints.

A range from-to, both inclusive.

Full

Fields

bits: usize

Bitsize of the integer this range constraints.

A range containing all bits long integer.

Implementations

Creates a new full ranges, bits large.

Returns true if the range includes no values.

Sets the lower bound to the unsigned value bound (inclusive).

Sets the lower bound to the signed value bound (inclusive).

Sets the upper bound to the unsigned value bound (inclusive).

Sets the upper bound to the signed value bound (inclusive).

Extends the range to include all values in other.

Limits this range to the values in other.

Limits the range to bound.

Move the range to exclude bound.

Size of the range bounds in bits.

Apply this range to v, returning either v itself of Undefined if it is outside.

Helper to convert value to a bits large signed integer.

Inverts the ranges to include all values it excluded before.

Returns the inverted range. See invert.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Compare self to key and return true if they are equal.

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.