Skip to main content

Int

Struct Int 

Source
pub struct Int<const BITS: usize, const LIMBS: usize>(/* private fields */);

Implementations§

Source§

impl<const BITS: usize, const LIMBS: usize> Int<BITS, LIMBS>

Source

pub const ZERO: Self

Source

pub const ONE: Self

Source

pub const MINUS_ONE: Self

Source

pub fn is_negative(&self) -> bool

Source

pub fn abs(&self) -> Uint<BITS, LIMBS>

Trait Implementations§

Source§

impl<const BITS: usize, const LIMBS: usize> Add for Int<BITS, LIMBS>

Source§

type Output = Int<BITS, LIMBS>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Self) -> Self::Output

Performs the + operation. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> Add<i8> for Int<BITS, LIMBS>

Source§

type Output = Int<BITS, LIMBS>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: i8) -> Self::Output

Performs the + operation. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> Add<i16> for Int<BITS, LIMBS>

Source§

type Output = Int<BITS, LIMBS>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: i16) -> Self::Output

Performs the + operation. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> Add<i32> for Int<BITS, LIMBS>

Source§

type Output = Int<BITS, LIMBS>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: i32) -> Self::Output

Performs the + operation. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> Add<i64> for Int<BITS, LIMBS>

Source§

type Output = Int<BITS, LIMBS>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: i64) -> Self::Output

Performs the + operation. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> Add<i128> for Int<BITS, LIMBS>

Source§

type Output = Int<BITS, LIMBS>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: i128) -> Self::Output

Performs the + operation. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> Add<u8> for Int<BITS, LIMBS>

Source§

type Output = Int<BITS, LIMBS>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: u8) -> Self::Output

Performs the + operation. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> Add<u16> for Int<BITS, LIMBS>

Source§

type Output = Int<BITS, LIMBS>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: u16) -> Self::Output

Performs the + operation. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> Add<u32> for Int<BITS, LIMBS>

Source§

type Output = Int<BITS, LIMBS>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: u32) -> Self::Output

Performs the + operation. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> Add<u64> for Int<BITS, LIMBS>

Source§

type Output = Int<BITS, LIMBS>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: u64) -> Self::Output

Performs the + operation. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> Add<u128> for Int<BITS, LIMBS>

Source§

type Output = Int<BITS, LIMBS>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: u128) -> Self::Output

Performs the + operation. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> Clone for Int<BITS, LIMBS>

Source§

fn clone(&self) -> Int<BITS, LIMBS>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> Copy for Int<BITS, LIMBS>

Source§

impl<const BITS: usize, const LIMBS: usize> Debug for Int<BITS, LIMBS>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> Div<i8> for Int<BITS, LIMBS>

Source§

type Output = Int<BITS, LIMBS>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: i8) -> Self::Output

Performs the / operation. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> Div<i16> for Int<BITS, LIMBS>

Source§

type Output = Int<BITS, LIMBS>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: i16) -> Self::Output

Performs the / operation. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> Div<i32> for Int<BITS, LIMBS>

Source§

type Output = Int<BITS, LIMBS>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: i32) -> Self::Output

Performs the / operation. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> Div<i64> for Int<BITS, LIMBS>

Source§

type Output = Int<BITS, LIMBS>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: i64) -> Self::Output

Performs the / operation. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> Div<i128> for Int<BITS, LIMBS>

Source§

type Output = Int<BITS, LIMBS>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: i128) -> Self::Output

Performs the / operation. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> Div<u8> for Int<BITS, LIMBS>

Source§

type Output = Int<BITS, LIMBS>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: u8) -> Self::Output

Performs the / operation. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> Div<u16> for Int<BITS, LIMBS>

Source§

type Output = Int<BITS, LIMBS>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: u16) -> Self::Output

Performs the / operation. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> Div<u32> for Int<BITS, LIMBS>

Source§

type Output = Int<BITS, LIMBS>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: u32) -> Self::Output

Performs the / operation. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> Div<u64> for Int<BITS, LIMBS>

Source§

type Output = Int<BITS, LIMBS>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: u64) -> Self::Output

Performs the / operation. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> Div<u128> for Int<BITS, LIMBS>

Source§

type Output = Int<BITS, LIMBS>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: u128) -> Self::Output

Performs the / operation. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> Eq for Int<BITS, LIMBS>

Source§

impl<const BITS: usize, const LIMBS: usize> Mul<i8> for Int<BITS, LIMBS>

Source§

type Output = Int<BITS, LIMBS>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: i8) -> Self::Output

Performs the * operation. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> Mul<i16> for Int<BITS, LIMBS>

Source§

type Output = Int<BITS, LIMBS>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: i16) -> Self::Output

Performs the * operation. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> Mul<i32> for Int<BITS, LIMBS>

Source§

type Output = Int<BITS, LIMBS>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: i32) -> Self::Output

Performs the * operation. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> Mul<i64> for Int<BITS, LIMBS>

Source§

type Output = Int<BITS, LIMBS>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: i64) -> Self::Output

Performs the * operation. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> Mul<i128> for Int<BITS, LIMBS>

Source§

type Output = Int<BITS, LIMBS>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: i128) -> Self::Output

Performs the * operation. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> Mul<u8> for Int<BITS, LIMBS>

Source§

type Output = Int<BITS, LIMBS>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: u8) -> Self::Output

Performs the * operation. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> Mul<u16> for Int<BITS, LIMBS>

Source§

type Output = Int<BITS, LIMBS>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: u16) -> Self::Output

Performs the * operation. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> Mul<u32> for Int<BITS, LIMBS>

Source§

type Output = Int<BITS, LIMBS>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: u32) -> Self::Output

Performs the * operation. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> Mul<u64> for Int<BITS, LIMBS>

Source§

type Output = Int<BITS, LIMBS>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: u64) -> Self::Output

Performs the * operation. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> Mul<u128> for Int<BITS, LIMBS>

Source§

type Output = Int<BITS, LIMBS>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: u128) -> Self::Output

Performs the * operation. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> Neg for Int<BITS, LIMBS>

Source§

type Output = Int<BITS, LIMBS>

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> PartialEq for Int<BITS, LIMBS>

Source§

fn eq(&self, other: &Int<BITS, LIMBS>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<const BITS: usize, const LIMBS: usize> Rem<i8> for Int<BITS, LIMBS>

Source§

type Output = Int<BITS, LIMBS>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: i8) -> Self::Output

Performs the % operation. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> Rem<i16> for Int<BITS, LIMBS>

Source§

type Output = Int<BITS, LIMBS>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: i16) -> Self::Output

Performs the % operation. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> Rem<i32> for Int<BITS, LIMBS>

Source§

type Output = Int<BITS, LIMBS>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: i32) -> Self::Output

Performs the % operation. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> Rem<i64> for Int<BITS, LIMBS>

Source§

type Output = Int<BITS, LIMBS>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: i64) -> Self::Output

Performs the % operation. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> Rem<i128> for Int<BITS, LIMBS>

Source§

type Output = Int<BITS, LIMBS>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: i128) -> Self::Output

Performs the % operation. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> Rem<u8> for Int<BITS, LIMBS>

Source§

type Output = Int<BITS, LIMBS>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: u8) -> Self::Output

Performs the % operation. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> Rem<u16> for Int<BITS, LIMBS>

Source§

type Output = Int<BITS, LIMBS>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: u16) -> Self::Output

Performs the % operation. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> Rem<u32> for Int<BITS, LIMBS>

Source§

type Output = Int<BITS, LIMBS>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: u32) -> Self::Output

Performs the % operation. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> Rem<u64> for Int<BITS, LIMBS>

Source§

type Output = Int<BITS, LIMBS>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: u64) -> Self::Output

Performs the % operation. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> Rem<u128> for Int<BITS, LIMBS>

Source§

type Output = Int<BITS, LIMBS>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: u128) -> Self::Output

Performs the % operation. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> StructuralPartialEq for Int<BITS, LIMBS>

Source§

impl<const BITS: usize, const LIMBS: usize> Sub for Int<BITS, LIMBS>

Source§

type Output = Int<BITS, LIMBS>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Self) -> Self::Output

Performs the - operation. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> Sub<i8> for Int<BITS, LIMBS>

Source§

type Output = Int<BITS, LIMBS>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: i8) -> Self::Output

Performs the - operation. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> Sub<i16> for Int<BITS, LIMBS>

Source§

type Output = Int<BITS, LIMBS>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: i16) -> Self::Output

Performs the - operation. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> Sub<i32> for Int<BITS, LIMBS>

Source§

type Output = Int<BITS, LIMBS>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: i32) -> Self::Output

Performs the - operation. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> Sub<i64> for Int<BITS, LIMBS>

Source§

type Output = Int<BITS, LIMBS>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: i64) -> Self::Output

Performs the - operation. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> Sub<i128> for Int<BITS, LIMBS>

Source§

type Output = Int<BITS, LIMBS>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: i128) -> Self::Output

Performs the - operation. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> Sub<u8> for Int<BITS, LIMBS>

Source§

type Output = Int<BITS, LIMBS>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: u8) -> Self::Output

Performs the - operation. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> Sub<u16> for Int<BITS, LIMBS>

Source§

type Output = Int<BITS, LIMBS>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: u16) -> Self::Output

Performs the - operation. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> Sub<u32> for Int<BITS, LIMBS>

Source§

type Output = Int<BITS, LIMBS>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: u32) -> Self::Output

Performs the - operation. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> Sub<u64> for Int<BITS, LIMBS>

Source§

type Output = Int<BITS, LIMBS>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: u64) -> Self::Output

Performs the - operation. Read more
Source§

impl<const BITS: usize, const LIMBS: usize> Sub<u128> for Int<BITS, LIMBS>

Source§

type Output = Int<BITS, LIMBS>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: u128) -> Self::Output

Performs the - operation. Read more

Auto Trait Implementations§

§

impl<const BITS: usize, const LIMBS: usize> Freeze for Int<BITS, LIMBS>

§

impl<const BITS: usize, const LIMBS: usize> RefUnwindSafe for Int<BITS, LIMBS>

§

impl<const BITS: usize, const LIMBS: usize> Send for Int<BITS, LIMBS>

§

impl<const BITS: usize, const LIMBS: usize> Sync for Int<BITS, LIMBS>

§

impl<const BITS: usize, const LIMBS: usize> Unpin for Int<BITS, LIMBS>

§

impl<const BITS: usize, const LIMBS: usize> UnsafeUnpin for Int<BITS, LIMBS>

§

impl<const BITS: usize, const LIMBS: usize> UnwindSafe for Int<BITS, LIMBS>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.