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(BitWidthBitWidth),
    InvalidBitWidth(usize),
    TruncationBitWidthTooLarge {
        target: BitWidth,
        current: BitWidth,
    },
    ExtensionBitWidthTooSmall {
        target: BitWidth,
        current: BitWidth,
    },
    ExpectedNonEmptyDigits,
}

Represents the kind of an Error.

This also stores the unique information tied to the error report.

Variants

Returned on trying to create a Radix from an invalid u8 representation.

Returned whenever trying to parse an invalid string representation for an ApInt.

Fields of InvalidStringRepr

The string storing the invalid representation of the int for the given radix.

The radix that was used.

An optional index and character when encountering an invalid character.

Returned on trying to access an invalid bit position.

Fields of InvalidBitAccess

The invalid bit position that was tried to access.

The upper bound for valid bit positions in this context.

Returned on trying to shift with an invalid shift amount.

Fields of InvalidShiftAmount

The invalid shift amount.

The bit width for which this shift amount of invalid.

Returns on trying to cast an ApInt to a primitive type that can not represent the value represented by the ApInt.

Fields of ValueUnrepresentable

The ApInt that the user wanted to represent as the given PrimitiveTy.

The PrimitiveTy that the user wanted for representing the given ApInt.

Returned on violation of matching bitwidth constraints of operations.

Returned on trying to create a BitWidth from an invalid usize representation.

Returned on truncating an ApInt with a bitwidth greater than the current one.

Fields of TruncationBitWidthTooLarge

The target bit width.

The current actual bit width.

Returned on extending an ApInt with a bitwidth less than the current one.

Fields of ExtensionBitWidthTooSmall

The target bit width.

The current actual bit width.

Returned on constructing an ApInt from an empty iterator of Digits.

Trait Implementations

impl Debug for ErrorKind
[src]

[src]

Formats the value using the given formatter. Read more

impl Clone for ErrorKind
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl PartialEq for ErrorKind
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

impl Eq for ErrorKind
[src]

impl Hash for ErrorKind
[src]

[src]

Feeds this value into the given [Hasher]. Read more

1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

Auto Trait Implementations

impl Send for ErrorKind

impl Sync for ErrorKind