# [−] Trait chain::bigint::uint::Uint

    pub trait Uint: PartialEq<Self> + Eq + Ord + PartialOrd<Self> + Default + From<u64> + FromStr + Hash + Debug + Display {
        fn zero() -> Self;
        fn one() -> Self;
        fn max_value() -> Self;
        fn from_dec_str(value: &str) -> Result<Self, FromDecStrErr>;
        fn low_u32(&self) -> u32;
        fn low_u64(&self) -> u64;
        fn as_u32(&self) -> u32;
        fn as_u64(&self) -> u64;
        fn bits(&self) -> usize;
        fn bit(&self, index: usize) -> bool;
        fn byte(&self, index: usize) -> u8;
        fn to_big_endian(&self, bytes: &mut [u8]);
        fn to_little_endian(&self, result: &mut [u8]);
        fn to_hex(&self) -> String;
        fn exp10(n: usize) -> Self;
        fn pow(self, other: Self) -> Self;
        fn overflowing_pow(self, other: Self) -> (Self, bool);
        fn overflowing_add(self, other: Self) -> (Self, bool);
        fn overflowing_sub(self, other: Self) -> (Self, bool);
        fn overflowing_mul(self, other: Self) -> (Self, bool);
        fn overflowing_div(self, other: Self) -> (Self, bool);
        fn overflowing_rem(self, other: Self) -> (Self, bool);
        fn overflowing_neg(self) -> (Self, bool);
        fn is_zero(&self) -> bool;
    }

Large, fixed-length unsigned integer type.

## Required Methods

### `fn zero() -> Self`

Returns new instance equalling zero.

### `fn one() -> Self`

Returns new instance equalling one.

### `fn max_value() -> Self`

Returns the largest value that can be represented by this integer type.

### `fn from_dec_str(value: &str) -> Result<Self, FromDecStrErr>`

Convert from a decimal string.

### `fn low_u32(&self) -> u32`

Conversion to u32

### `fn low_u64(&self) -> u64`

Conversion to u64

### `fn as_u32(&self) -> u32`

Conversion to u32 with overflow checking

### `fn as_u64(&self) -> u64`

Conversion to u64 with overflow checking

### `fn bits(&self) -> usize`

Return the least number of bits needed to represent the number

### `fn bit(&self, index: usize) -> bool`

Return if specific bit is set

### `fn byte(&self, index: usize) -> u8`

Return single byte

### `fn to_big_endian(&self, bytes: &mut [u8])`

Convert to the sequence of bytes with a big endian

### `fn to_little_endian(&self, result: &mut [u8])`

Convert to the sequence of bytes with a little endian

### `fn to_hex(&self) -> String`

Convert to a non-zero-prefixed hex representation (not prefixed by `0x`).

### `fn exp10(n: usize) -> Self`

Create `Uint(10**n)`

### `fn pow(self, other: Self) -> Self`

Return eponentation `self**other`. Panic on overflow.

### `fn overflowing_pow(self, other: Self) -> (Self, bool)`

Return wrapped eponentation `self**other` and flag if there was an overflow

### `fn overflowing_add(self, other: Self) -> (Self, bool)`

Add this `Uint` to other returning result and possible overflow

### `fn overflowing_sub(self, other: Self) -> (Self, bool)`

Subtract another `Uint` from this returning result and possible overflow

### `fn overflowing_mul(self, other: Self) -> (Self, bool)`

Multiple this `Uint` with other returning result and possible overflow

### `fn overflowing_div(self, other: Self) -> (Self, bool)`

Divide this `Uint` by other returning result and possible overflow

### `fn overflowing_rem(self, other: Self) -> (Self, bool)`

Returns reminder of division of this `Uint` by other and possible overflow

### `fn overflowing_neg(self) -> (Self, bool)`

Returns negation of this `Uint` and overflow (always true)

### `fn is_zero(&self) -> bool`

Returns

## Implementors

###

`impl Uint for U128`

####

`fn from_dec_str(value: &str) -> Result<U128, FromDecStrErr>` |

####

`fn low_u32(&self) -> u32` |

####

`fn low_u64(&self) -> u64` |

####

`fn as_u32(&self) -> u32` |

Conversion to u32 with overflow checking

####

`fn as_u64(&self) -> u64` |

Conversion to u64 with overflow checking

####

`fn is_zero(&self) -> bool` |

####

`fn bits(&self) -> usize` |

Return the least number of bits needed to represent the number

####

`fn bit(&self, index: usize) -> bool` |

####

`fn byte(&self, index: usize) -> u8` |

####

`fn to_big_endian(&self, bytes: &mut [u8])` |

####

`fn to_little_endian(&self, bytes: &mut [u8])` |

####

`fn to_hex(&self) -> String` |

####

`fn exp10(n: usize) -> U128` |

####

`fn zero() -> U128` |

####

`fn one() -> U128` |

####

`fn max_value() -> U128` |

####

`fn pow(self, expon: U128) -> U128` |

Fast exponentation by squaring https://en.wikipedia.org/wiki/Exponentiation_by_squaring

####

`fn overflowing_pow(self, expon: U128) -> (U128, bool)` |

Fast exponentation by squaring https://en.wikipedia.org/wiki/Exponentiation_by_squaring

####

`fn overflowing_add(self, other: U128) -> (U128, bool)` |

Optimized instructions

####

`fn overflowing_sub(self, other: U128) -> (U128, bool)` |

####

`fn overflowing_mul(self, other: U128) -> (U128, bool)` |

####

`fn overflowing_div(self, other: U128) -> (U128, bool)` |

####

`fn overflowing_rem(self, other: U128) -> (U128, bool)` |

####

`fn overflowing_neg(self) -> (U128, bool)` |

###

`impl Uint for U256`

####

`fn from_dec_str(value: &str) -> Result<U256, FromDecStrErr>` |

####

`fn low_u32(&self) -> u32` |

####

`fn low_u64(&self) -> u64` |

####

`fn as_u32(&self) -> u32` |

Conversion to u32 with overflow checking

####

`fn as_u64(&self) -> u64` |

Conversion to u64 with overflow checking

####

`fn is_zero(&self) -> bool` |

####

`fn bits(&self) -> usize` |

Return the least number of bits needed to represent the number

####

`fn bit(&self, index: usize) -> bool` |

####

`fn byte(&self, index: usize) -> u8` |

####

`fn to_big_endian(&self, bytes: &mut [u8])` |

####

`fn to_little_endian(&self, bytes: &mut [u8])` |

####

`fn to_hex(&self) -> String` |

####

`fn exp10(n: usize) -> U256` |

####

`fn zero() -> U256` |

####

`fn one() -> U256` |

####

`fn max_value() -> U256` |

####

`fn pow(self, expon: U256) -> U256` |

Fast exponentation by squaring https://en.wikipedia.org/wiki/Exponentiation_by_squaring

####

`fn overflowing_pow(self, expon: U256) -> (U256, bool)` |

Fast exponentation by squaring https://en.wikipedia.org/wiki/Exponentiation_by_squaring

####

`fn overflowing_add(self, other: U256) -> (U256, bool)` |

Optimized instructions

####

`fn overflowing_sub(self, other: U256) -> (U256, bool)` |

####

`fn overflowing_mul(self, other: U256) -> (U256, bool)` |

####

`fn overflowing_div(self, other: U256) -> (U256, bool)` |

####

`fn overflowing_rem(self, other: U256) -> (U256, bool)` |

####

`fn overflowing_neg(self) -> (U256, bool)` |

###

`impl Uint for U512`

####

`fn from_dec_str(value: &str) -> Result<U512, FromDecStrErr>` |

####

`fn low_u32(&self) -> u32` |

####

`fn low_u64(&self) -> u64` |

####

`fn as_u32(&self) -> u32` |

Conversion to u32 with overflow checking

####

`fn as_u64(&self) -> u64` |

Conversion to u64 with overflow checking

####

`fn is_zero(&self) -> bool` |

####

`fn bits(&self) -> usize` |

Return the least number of bits needed to represent the number

####

`fn bit(&self, index: usize) -> bool` |

####

`fn byte(&self, index: usize) -> u8` |

####

`fn to_big_endian(&self, bytes: &mut [u8])` |

####

`fn to_little_endian(&self, bytes: &mut [u8])` |

####

`fn to_hex(&self) -> String` |

####

`fn exp10(n: usize) -> U512` |

####

`fn zero() -> U512` |

####

`fn one() -> U512` |

####

`fn max_value() -> U512` |

####

`fn pow(self, expon: U512) -> U512` |

Fast exponentation by squaring https://en.wikipedia.org/wiki/Exponentiation_by_squaring

####

`fn overflowing_pow(self, expon: U512) -> (U512, bool)` |

Fast exponentation by squaring https://en.wikipedia.org/wiki/Exponentiation_by_squaring

####

`fn overflowing_add(self, other: U512) -> (U512, bool)` |

Optimized instructions

####

`fn overflowing_sub(self, other: U512) -> (U512, bool)` |

####

`fn overflowing_mul(self, other: U512) -> (U512, bool)` |

####

`fn overflowing_div(self, other: U512) -> (U512, bool)` |

####

`fn overflowing_rem(self, other: U512) -> (U512, bool)` |

####

`fn overflowing_neg(self) -> (U512, bool)` |

# Help

## Keyboard Shortcuts

`?`
  Show this help dialog
`S`
  Focus the search field
`↑`
  Move up in search results
`↓`
  Move down in search results
`↹`
  Switch tab
`⏎`
  Go to active search result
`+`
  Expand all sections
`-`
  Collapse all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)

Search multiple things at once by splitting your query with comma (e.g. `str,u8` or `String,struct:Vec,test`)