Enum apint::ErrorKind [−][src]
pub enum ErrorKind { InvalidRadix(u8), InvalidStringRepr { input: String, radix: Radix, pos_char: Option<(usize, char)>, }, InvalidBitAccess { pos: BitPos, width: BitWidth, }, InvalidShiftAmount { shift_amount: ShiftAmount, width: BitWidth, }, ValueUnrepresentable { value: ApInt, destination_ty: PrimitiveTy, }, UnmatchingBitwidth(BitWidth, BitWidth), InvalidBitWidth(usize), TruncationBitWidthTooLarge { target: BitWidth, current: BitWidth, }, ExtensionBitWidthTooSmall { target: BitWidth, current: BitWidth, }, DivisionByZero { op: DivOp, lhs: ApInt, }, ExpectedNonEmptyDigits, }
Represents the kind of an Error
.
This also stores the unique information tied to the error report.
Variants
InvalidRadix(u8)
Returned on trying to create a Radix
from an invalid u8
representation.
InvalidStringRepr
Returned whenever trying to parse an invalid string representation for an ApInt
.
Fields of InvalidStringRepr
input: String | The string storing the invalid representation of the int for the given radix. |
radix: Radix | The radix that was used. |
pos_char: Option<(usize, char)> | An optional index and character when encountering an invalid character. |
InvalidBitAccess
Returned on trying to access an invalid bit position.
Fields of InvalidBitAccess
pos: BitPos | The invalid bit position that was tried to access. |
width: BitWidth | The upper bound for valid bit positions in this context. |
InvalidShiftAmount
Returned on trying to shift with an invalid shift amount.
Fields of InvalidShiftAmount
shift_amount: ShiftAmount | The invalid shift amount. |
width: BitWidth | The bit width for which this shift amount of invalid. |
ValueUnrepresentable
Returns on trying to cast an ApInt
to a primitive type
that can not represent the value represented by the ApInt
.
Fields of ValueUnrepresentable
value: ApInt | The |
destination_ty: PrimitiveTy | The |
UnmatchingBitwidth(BitWidth, BitWidth)
Returned on violation of matching bitwidth constraints of operations.
InvalidBitWidth(usize)
Returned on trying to create a BitWidth
from an invalid usize
representation.
TruncationBitWidthTooLarge
Returned on truncating an ApInt
with a bitwidth greater than the current one.
Fields of TruncationBitWidthTooLarge
target: BitWidth | The target bit width. |
current: BitWidth | The current actual bit width. |
ExtensionBitWidthTooSmall
Returned on extending an ApInt
with a bitwidth less than the current one.
Fields of ExtensionBitWidthTooSmall
target: BitWidth | The target bit width. |
current: BitWidth | The current actual bit width. |
DivisionByZero
Returned on division by zero.
Fields of DivisionByZero
op: DivOp | The exact division operation. |
lhs: ApInt | The left-hand side of the division. |
ExpectedNonEmptyDigits
Returned on constructing an ApInt
from an empty iterator of Digit
s.
Trait Implementations
impl Debug for ErrorKind
[src]
impl Debug for ErrorKind
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Clone for ErrorKind
[src]
impl Clone for ErrorKind
fn clone(&self) -> ErrorKind
[src]
fn clone(&self) -> ErrorKind
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl PartialEq for ErrorKind
[src]
impl PartialEq for ErrorKind
fn eq(&self, other: &ErrorKind) -> bool
[src]
fn eq(&self, other: &ErrorKind) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &ErrorKind) -> bool
[src]
fn ne(&self, other: &ErrorKind) -> bool
This method tests for !=
.
impl Eq for ErrorKind
[src]
impl Eq for ErrorKind
impl Hash for ErrorKind
[src]
impl Hash for ErrorKind