Struct apint::BitWidth [] [src]

pub struct BitWidth(_);

The BitWidth represents the length of an APInt.

Its invariant restricts it to always be a positive, non-zero value. Code that built's on top of BitWidth may and should use this invariant.

Methods

impl BitWidth
[src]

[src]

Creates a BitWidth that represents a bit-width of 1 bit.

[src]

Creates a BitWidth that represents a bit-width of 8 bits.

[src]

Creates a BitWidth that represents a bit-width of 16 bits.

[src]

Creates a BitWidth that represents a bit-width of 32 bits.

[src]

Creates a BitWidth that represents a bit-width of 64 bits.

[src]

Creates a BitWidth from the given usize.

Errors

  • When encountering a given bitwidth of zero (0).

impl BitWidth
[src]

[src]

Converts this BitWidth into a usize.

Trait Implementations

impl Debug for BitWidth
[src]

[src]

Formats the value using the given formatter.

impl Copy for BitWidth
[src]

impl Clone for BitWidth
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl PartialEq for BitWidth
[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 BitWidth
[src]

impl Hash for BitWidth
[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

impl TryFrom<usize> for BitWidth
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

[src]

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.