Skip to main content

NonZero

Struct NonZero 

Source
pub struct NonZero<T: ?Sized>(/* private fields */);
Expand description

Wrapper type for non-zero integers.

Implementations§

Source§

impl<const LIMBS: usize> NonZero<Int<LIMBS>>

Source

pub const fn gcd_unsigned(&self, rhs: &Uint<LIMBS>) -> NonZero<Uint<LIMBS>>

Compute the greatest common divisor of self and rhs.

Source

pub const fn gcd_unsigned_vartime( &self, rhs: &Uint<LIMBS>, ) -> NonZeroUint<LIMBS>

Compute the greatest common divisor of self and rhs.

Executes in variable time w.r.t. all input parameters.

Source

pub const fn xgcd(&self, rhs: &Self) -> XgcdOutput<LIMBS, NonZeroUint<LIMBS>>

Execute the Extended GCD algorithm.

Given (self, rhs), computes (g, x, y) s.t. self * x + rhs * y = g = gcd(self, rhs).

Source§

impl<T> NonZero<T>

Source

pub fn new(n: T) -> CtOption<Self>
where T: Zero + One + CtAssign,

Create a new non-zero integer.

Source

pub fn get(self) -> T

Returns the inner value.

Source

pub const fn get_copy(self) -> T
where T: Copy,

Returns a copy of the inner value for Copy types.

This allows the function to be const fn, since Copy is implicitly !Drop, which avoids problems around const fn destructors.

Source§

impl<T: ?Sized> NonZero<T>

Source

pub const fn as_ref(&self) -> &T

Provides access to the contents of NonZero in a const context.

Source§

impl<T> NonZero<T>
where T: Bounded + ?Sized,

Source

pub const BITS: u32 = T::BITS

Total size of the represented integer in bits.

Source

pub const BYTES: usize = T::BYTES

Total size of the represented integer in bytes.

Source§

impl<T> NonZero<T>
where T: Constants,

Source

pub const ONE: Self

The value 1.

Source

pub const MAX: Self

Maximum value this integer can express.

Source§

impl<T> NonZero<T>
where T: Zero + One + CtAssign + Encoding,

Source

pub fn from_be_bytes(bytes: T::Repr) -> CtOption<Self>

Decode from big endian bytes.

Source

pub fn from_le_bytes(bytes: T::Repr) -> CtOption<Self>

Decode from little endian bytes.

Source§

impl NonZero<Limb>

Source

pub const fn new_unwrap(n: Limb) -> Self

Creates a new non-zero limb in a const context.

§Panics
  • if the value is zero.
§Note

In future versions of Rust it should be possible to replace this with NonZero::new(…).unwrap()

Source

pub const fn from_u8(n: NonZeroU8) -> Self

Create a NonZero<Limb> from a NonZeroU8 (const-friendly)

Source

pub const fn from_u16(n: NonZeroU16) -> Self

Create a NonZero<Limb> from a NonZeroU16 (const-friendly)

Source

pub const fn from_u32(n: NonZeroU32) -> Self

Create a NonZero<Limb> from a NonZeroU32 (const-friendly)

Source

pub const fn from_u64(n: NonZeroU64) -> Self

Create a NonZero<Limb> from a NonZeroU64 (const-friendly)

Source§

impl<const LIMBS: usize> NonZero<Uint<LIMBS>>

Source

pub const fn new_unwrap(n: Uint<LIMBS>) -> Self

Creates a new non-zero integer in a const context.

In future versions of Rust it should be possible to replace this with NonZero::new(…).unwrap()

§Panics
  • if the value is zero.
Source

pub const fn from_be_hex(hex: &str) -> Self

Create a new NonZero<Uint> from the provided big endian hex string.

§Panics
  • if the hex is zero, malformed, or not zero-padded accordingly for the size.
Source

pub const fn from_le_hex(hex: &str) -> Self

Create a new NonZero<Uint> from the provided little endian hex string.

§Panics
  • if the hex is zero, malformed, or not zero-padded accordingly for the size.
Source

pub const fn from_u8(n: NonZeroU8) -> Self

Create a NonZeroUint from a NonZeroU8 (const-friendly)

Source

pub const fn from_u16(n: NonZeroU16) -> Self

Create a NonZeroUint from a NonZeroU16 (const-friendly)

Source

pub const fn from_u32(n: NonZeroU32) -> Self

Create a NonZeroUint from a NonZeroU32 (const-friendly)

Source

pub const fn from_u64(n: NonZeroU64) -> Self

Create a NonZeroUint from a NonZeroU64 (const-friendly)

Source

pub const fn from_u128(n: NonZeroU128) -> Self

Create a NonZeroUint from a NonZeroU128 (const-friendly)

Source

pub const fn as_uint_ref(&self) -> &NonZeroUintRef

Borrow this NonZero<Uint> as a &NonZeroUintRef.

Source§

impl<const LIMBS: usize> NonZero<Int<LIMBS>>

Source

pub const fn new_unwrap(n: Int<LIMBS>) -> Self

Creates a new non-zero integer in a const context.

§Panics
  • if the value is zero.
§Note

In future versions of Rust it should be possible to replace this with NonZero::new(…).unwrap()

Source

pub const fn abs_sign(&self) -> (NonZero<Uint<LIMBS>>, Choice)

The sign and magnitude of this NonZeroInt.

Source

pub const fn abs(&self) -> NonZero<Uint<LIMBS>>

The magnitude of this NonZeroInt.

Source§

impl NonZero<BoxedUint>

Source

pub fn as_uint_ref(&self) -> &NonZeroUintRef

Available on crate feature alloc only.

Borrow this NonZeroBoxedUint as a &NonZeroUintRef.

Source§

impl<T: ToUnsigned + ?Sized> NonZero<T>

Source

pub fn to_unsigned(&self) -> NonZero<T::Unsigned>

Convert from a reference into an owned NonZero<T: Unsigned>.

Source§

impl<T> NonZero<T>
where T: ArrayEncoding + Zero + One + CtAssign,

Source

pub fn from_be_byte_array(bytes: ByteArray<T>) -> CtOption<Self>

Available on crate feature hybrid-array only.

Decode a non-zero integer from big endian bytes.

Source

pub fn from_le_byte_array(bytes: ByteArray<T>) -> CtOption<Self>

Available on crate feature hybrid-array only.

Decode a non-zero integer from little endian bytes.

Source§

impl<const LIMBS: usize> NonZero<Uint<LIMBS>>

Source

pub const fn gcd_unsigned(&self, rhs: &Uint<LIMBS>) -> Self

Compute the greatest common divisor of self and rhs.

Source

pub const fn gcd_unsigned_vartime(&self, rhs: &Uint<LIMBS>) -> Self

Compute the greatest common divisor of self and rhs.

Executes in variable time w.r.t. all input parameters.

Source

pub const fn xgcd(&self, rhs: &Self) -> XgcdOutput<LIMBS, NonZeroUint<LIMBS>>

Execute the Extended GCD algorithm.

Given (self, rhs), computes (g, x, y) s.t. self * x + rhs * y = g = gcd(self, rhs).

Source§

impl<const LIMBS: usize> NonZero<Uint<LIMBS>>

Source

pub const fn floor_root_vartime(&self, exp: NonZeroU32) -> Self

Computes floor(self^(1/exp)).

Callers can check if self is an exact power of exp by exponentiating the result.

This method is variable time in self and in the exponent.

Source

pub fn checked_root_vartime(&self, exp: NonZeroU32) -> Option<Self>

Compute the root self^(1/exp) returning an Option which is_some only if the root is exact.

This method is variable time in self and in the exponent.

Source§

impl<const LIMBS: usize> NonZero<Uint<LIMBS>>

Source

pub const fn floor_sqrt(&self) -> Self

Computes floor(√(self)) in constant time.

Callers can check if self is a square by squaring the result.

Source

pub const fn floor_sqrt_vartime(&self) -> Self

Computes floor(√(self)).

Callers can check if self is a square by squaring the result.

Variable time with respect to self.

Source

pub fn checked_sqrt(&self) -> CtOption<Self>

Perform checked sqrt, returning a CtOption which is_some only if the square root is exact.

Source

pub fn checked_sqrt_vartime(&self) -> Option<Self>

Perform checked sqrt, returning an Option which is_some only if the square root is exact.

Trait Implementations§

Source§

impl<T: ?Sized> AsRef<NonZero<T>> for Odd<T>

Source§

fn as_ref(&self) -> &NonZero<T>

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<NonZero<UintRef>> for NonZeroBoxedUint

Available on crate feature alloc only.
Source§

fn as_ref(&self) -> &NonZeroUintRef

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<const LIMBS: usize> AsRef<NonZero<UintRef>> for NonZeroUint<LIMBS>

Source§

fn as_ref(&self) -> &NonZeroUintRef

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<T: ?Sized> AsRef<T> for NonZero<T>

Source§

fn as_ref(&self) -> &T

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<T> Binary for NonZero<T>
where T: Binary + ?Sized,

Source§

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

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

impl<const LIMBS: usize> CheckedSquareRoot for NonZero<Uint<LIMBS>>

Source§

type Output = NonZero<Uint<LIMBS>>

Output of the square root operation.
Source§

fn checked_sqrt(&self) -> CtOption<Self>

Computes sqrt(self), returning none if no root exists.
Source§

fn checked_sqrt_vartime(&self) -> Option<Self>

Computes sqrt(self), returning none if no root exists. Read more
Source§

impl<T: Clone + ?Sized> Clone for NonZero<T>

Source§

fn clone(&self) -> NonZero<T>

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<T> ConditionallySelectable for NonZero<T>
where T: Copy, Self: CtSelect,

Available on crate feature subtle only.
Source§

fn conditional_select(a: &Self, b: &Self, choice: Choice) -> Self

Select a or b according to choice. Read more
Source§

fn conditional_assign(&mut self, other: &Self, choice: Choice)

Conditionally assign other to self, according to choice. Read more
Source§

fn conditional_swap(a: &mut Self, b: &mut Self, choice: Choice)

Conditionally swap self and other if choice == 1; otherwise, reassign both unto themselves. Read more
Source§

impl<T> ConstOne for NonZero<T>
where T: ConstOne + One,

Source§

const ONE: Self

The multiplicative identity element of Self, 1.
Source§

impl<T> ConstantTimeEq for NonZero<T>
where T: ?Sized, Self: CtEq,

Available on crate feature subtle only.
Source§

fn ct_eq(&self, other: &Self) -> Choice

Determine if two items are equal. Read more
Source§

fn ct_ne(&self, other: &Self) -> Choice

Determine if two items are NOT equal. Read more
Source§

impl<T> CtAssign for NonZero<T>
where T: CtAssign,

Source§

fn ct_assign(&mut self, other: &Self, choice: Choice)

Conditionally assign src to self if choice is Choice::TRUE.
Source§

impl<T> CtAssignSlice for NonZero<T>
where T: CtAssign,

Source§

fn ct_assign_slice(dst: &mut [Self], src: &[Self], choice: Choice)

Conditionally assign src to dst if choice is Choice::TRUE, or leave it unchanged for Choice::FALSE.
Source§

impl<T> CtEq for NonZero<T>
where T: CtEq + ?Sized,

Source§

fn ct_eq(&self, other: &Self) -> Choice

Determine if self is equal to other in constant-time.
Source§

fn ct_ne(&self, other: &Rhs) -> Choice

Determine if self is NOT equal to other in constant-time.
Source§

impl<T> CtEqSlice for NonZero<T>
where T: CtEq,

Source§

fn ct_eq_slice(a: &[Self], b: &[Self]) -> Choice

Determine if a is equal to b in constant-time.
Source§

fn ct_ne_slice(a: &[Self], b: &[Self]) -> Choice

Determine if a is NOT equal to b in constant-time.
Source§

impl<T> CtSelect for NonZero<T>
where T: CtSelect,

Source§

fn ct_select(&self, other: &Self, choice: Choice) -> Self

Select between self and other based on choice, returning a copy of the value. Read more
Source§

fn ct_swap(&mut self, other: &mut Self, choice: Choice)

Conditionally swap self and other if choice is Choice::TRUE.
Source§

impl<T: Debug + ?Sized> Debug for NonZero<T>

Source§

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

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

impl<T> Default for NonZero<T>
where T: One,

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<T: ?Sized> Deref for NonZero<T>

Source§

type Target = T

The resulting type after dereferencing.
Source§

fn deref(&self) -> &T

Dereferences the value.
Source§

impl<'de, T: Deserialize<'de> + Zero> Deserialize<'de> for NonZero<T>

Available on crate feature serde only.
Source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<T> Display for NonZero<T>
where T: Display + ?Sized,

Source§

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

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

impl<const LIMBS: usize, const RHS_LIMBS: usize> Div<&NonZero<Int<RHS_LIMBS>>> for &Int<LIMBS>

Source§

type Output = CtOption<Int<LIMBS>>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &NonZero<Int<RHS_LIMBS>>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize> Div<&NonZero<Int<RHS_LIMBS>>> for &Wrapping<Int<LIMBS>>

Source§

type Output = Wrapping<Int<LIMBS>>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &NonZero<Int<RHS_LIMBS>>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize> Div<&NonZero<Int<RHS_LIMBS>>> for Int<LIMBS>

Source§

type Output = CtOption<Int<LIMBS>>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &NonZero<Int<RHS_LIMBS>>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize> Div<&NonZero<Int<RHS_LIMBS>>> for Wrapping<Int<LIMBS>>

Source§

type Output = Wrapping<Int<LIMBS>>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &NonZero<Int<RHS_LIMBS>>) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<&NonZero<Limb>> for &Limb

Source§

type Output = Limb

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &NonZero<Limb>) -> Limb

Performs the / operation. Read more
Source§

impl<const LIMBS: usize> Div<&NonZero<Limb>> for &Uint<LIMBS>

Source§

type Output = Uint<LIMBS>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &NonZero<Limb>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const LIMBS: usize> Div<&NonZero<Limb>> for &Wrapping<Uint<LIMBS>>

Source§

type Output = Wrapping<Uint<LIMBS>>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &NonZero<Limb>) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<&NonZero<Limb>> for Limb

Source§

type Output = Limb

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &NonZero<Limb>) -> Self

Performs the / operation. Read more
Source§

impl<const LIMBS: usize> Div<&NonZero<Limb>> for Uint<LIMBS>

Source§

type Output = Uint<LIMBS>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &NonZero<Limb>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const LIMBS: usize> Div<&NonZero<Limb>> for Wrapping<Uint<LIMBS>>

Source§

type Output = Wrapping<Uint<LIMBS>>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &NonZero<Limb>) -> Self::Output

Performs the / operation. Read more
Source§

impl<Rhs: ToUnsigned + ?Sized> Div<&NonZero<Rhs>> for &BoxedUint

Available on crate feature alloc only.
Source§

type Output = BoxedUint

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &NonZero<Rhs>) -> Self::Output

Performs the / operation. Read more
Source§

impl<Rhs: ToUnsigned + ?Sized> Div<&NonZero<Rhs>> for &Wrapping<BoxedUint>

Available on crate feature alloc only.
Source§

type Output = Wrapping<BoxedUint>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &NonZero<Rhs>) -> Self::Output

Performs the / operation. Read more
Source§

impl<Rhs: ToUnsigned + ?Sized> Div<&NonZero<Rhs>> for BoxedUint

Available on crate feature alloc only.
Source§

type Output = BoxedUint

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &NonZero<Rhs>) -> Self::Output

Performs the / operation. Read more
Source§

impl<Rhs: ToUnsigned + ?Sized> Div<&NonZero<Rhs>> for Wrapping<BoxedUint>

Available on crate feature alloc only.
Source§

type Output = Wrapping<BoxedUint>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &NonZero<Rhs>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize> Div<&NonZero<Uint<RHS_LIMBS>>> for &Int<LIMBS>

Source§

type Output = Int<LIMBS>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &NonZero<Uint<RHS_LIMBS>>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize> Div<&NonZero<Uint<RHS_LIMBS>>> for &Uint<LIMBS>

Source§

type Output = Uint<LIMBS>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &NonZero<Uint<RHS_LIMBS>>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize> Div<&NonZero<Uint<RHS_LIMBS>>> for &Wrapping<Int<LIMBS>>

Source§

type Output = Wrapping<Int<LIMBS>>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &NonZero<Uint<RHS_LIMBS>>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize> Div<&NonZero<Uint<RHS_LIMBS>>> for &Wrapping<Uint<LIMBS>>

Source§

type Output = Wrapping<Uint<LIMBS>>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &NonZero<Uint<RHS_LIMBS>>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize> Div<&NonZero<Uint<RHS_LIMBS>>> for Int<LIMBS>

Source§

type Output = Int<LIMBS>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &NonZero<Uint<RHS_LIMBS>>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize> Div<&NonZero<Uint<RHS_LIMBS>>> for Uint<LIMBS>

Source§

type Output = Uint<LIMBS>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &NonZero<Uint<RHS_LIMBS>>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize> Div<&NonZero<Uint<RHS_LIMBS>>> for Wrapping<Int<LIMBS>>

Source§

type Output = Wrapping<Int<LIMBS>>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &NonZero<Uint<RHS_LIMBS>>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize> Div<&NonZero<Uint<RHS_LIMBS>>> for Wrapping<Uint<LIMBS>>

Source§

type Output = Wrapping<Uint<LIMBS>>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &NonZero<Uint<RHS_LIMBS>>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize> Div<NonZero<Int<RHS_LIMBS>>> for &Int<LIMBS>

Source§

type Output = CtOption<Int<LIMBS>>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: NonZero<Int<RHS_LIMBS>>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize> Div<NonZero<Int<RHS_LIMBS>>> for &Wrapping<Int<LIMBS>>

Source§

type Output = Wrapping<Int<LIMBS>>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: NonZero<Int<RHS_LIMBS>>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize> Div<NonZero<Int<RHS_LIMBS>>> for Int<LIMBS>

Source§

type Output = CtOption<Int<LIMBS>>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: NonZero<Int<RHS_LIMBS>>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize> Div<NonZero<Int<RHS_LIMBS>>> for Wrapping<Int<LIMBS>>

Source§

type Output = Wrapping<Int<LIMBS>>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: NonZero<Int<RHS_LIMBS>>) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<NonZero<Limb>> for &Limb

Source§

type Output = Limb

The resulting type after applying the / operator.
Source§

fn div(self, rhs: NonZero<Limb>) -> Limb

Performs the / operation. Read more
Source§

impl<const LIMBS: usize> Div<NonZero<Limb>> for &Uint<LIMBS>

Source§

type Output = Uint<LIMBS>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: NonZero<Limb>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const LIMBS: usize> Div<NonZero<Limb>> for &Wrapping<Uint<LIMBS>>

Source§

type Output = Wrapping<Uint<LIMBS>>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: NonZero<Limb>) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<NonZero<Limb>> for Limb

Source§

type Output = Limb

The resulting type after applying the / operator.
Source§

fn div(self, rhs: NonZero<Limb>) -> Self

Performs the / operation. Read more
Source§

impl<const LIMBS: usize> Div<NonZero<Limb>> for Uint<LIMBS>

Source§

type Output = Uint<LIMBS>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: NonZero<Limb>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const LIMBS: usize> Div<NonZero<Limb>> for Wrapping<Uint<LIMBS>>

Source§

type Output = Wrapping<Uint<LIMBS>>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: NonZero<Limb>) -> Self::Output

Performs the / operation. Read more
Source§

impl<Rhs: AsMut<UintRef>> Div<NonZero<Rhs>> for &BoxedUint

Available on crate feature alloc only.
Source§

type Output = BoxedUint

The resulting type after applying the / operator.
Source§

fn div(self, rhs: NonZero<Rhs>) -> Self::Output

Performs the / operation. Read more
Source§

impl<Rhs: AsMut<UintRef>> Div<NonZero<Rhs>> for &Wrapping<BoxedUint>

Available on crate feature alloc only.
Source§

type Output = Wrapping<BoxedUint>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: NonZero<Rhs>) -> Self::Output

Performs the / operation. Read more
Source§

impl<Rhs: AsMut<UintRef>> Div<NonZero<Rhs>> for BoxedUint

Available on crate feature alloc only.
Source§

type Output = BoxedUint

The resulting type after applying the / operator.
Source§

fn div(self, rhs: NonZero<Rhs>) -> Self::Output

Performs the / operation. Read more
Source§

impl<Rhs: AsMut<UintRef>> Div<NonZero<Rhs>> for Wrapping<BoxedUint>

Available on crate feature alloc only.
Source§

type Output = Wrapping<BoxedUint>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: NonZero<Rhs>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize> Div<NonZero<Uint<RHS_LIMBS>>> for &Int<LIMBS>

Source§

type Output = Int<LIMBS>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: NonZero<Uint<RHS_LIMBS>>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize> Div<NonZero<Uint<RHS_LIMBS>>> for &Uint<LIMBS>

Source§

type Output = Uint<LIMBS>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: NonZero<Uint<RHS_LIMBS>>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize> Div<NonZero<Uint<RHS_LIMBS>>> for &Wrapping<Int<LIMBS>>

Source§

type Output = Wrapping<Int<LIMBS>>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: NonZero<Uint<RHS_LIMBS>>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize> Div<NonZero<Uint<RHS_LIMBS>>> for &Wrapping<Uint<LIMBS>>

Source§

type Output = Wrapping<Uint<LIMBS>>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: NonZero<Uint<RHS_LIMBS>>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize> Div<NonZero<Uint<RHS_LIMBS>>> for Int<LIMBS>

Source§

type Output = Int<LIMBS>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: NonZero<Uint<RHS_LIMBS>>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize> Div<NonZero<Uint<RHS_LIMBS>>> for Uint<LIMBS>

Source§

type Output = Uint<LIMBS>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: NonZero<Uint<RHS_LIMBS>>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize> Div<NonZero<Uint<RHS_LIMBS>>> for Wrapping<Int<LIMBS>>

Source§

type Output = Wrapping<Int<LIMBS>>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: NonZero<Uint<RHS_LIMBS>>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize> Div<NonZero<Uint<RHS_LIMBS>>> for Wrapping<Uint<LIMBS>>

Source§

type Output = Wrapping<Uint<LIMBS>>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: NonZero<Uint<RHS_LIMBS>>) -> Self::Output

Performs the / operation. Read more
Source§

impl<const LIMBS: usize> DivAssign<&NonZero<Int<LIMBS>>> for Int<LIMBS>

Source§

fn div_assign(&mut self, rhs: &NonZero<Int<LIMBS>>)

Performs the /= operation. Read more
Source§

impl<const LIMBS: usize> DivAssign<&NonZero<Int<LIMBS>>> for Wrapping<Int<LIMBS>>

Source§

fn div_assign(&mut self, rhs: &NonZero<Int<LIMBS>>)

Performs the /= operation. Read more
Source§

impl DivAssign<&NonZero<Limb>> for Limb

Source§

fn div_assign(&mut self, rhs: &NonZero<Limb>)

Performs the /= operation. Read more
Source§

impl<const LIMBS: usize> DivAssign<&NonZero<Limb>> for Uint<LIMBS>

Source§

fn div_assign(&mut self, rhs: &NonZero<Limb>)

Performs the /= operation. Read more
Source§

impl<const LIMBS: usize> DivAssign<&NonZero<Limb>> for Wrapping<Uint<LIMBS>>

Source§

fn div_assign(&mut self, rhs: &NonZero<Limb>)

Performs the /= operation. Read more
Source§

impl<Rhs: ToUnsigned + ?Sized> DivAssign<&NonZero<Rhs>> for BoxedUint

Available on crate feature alloc only.
Source§

fn div_assign(&mut self, rhs: &NonZero<Rhs>)

Performs the /= operation. Read more
Source§

impl<Rhs: ToUnsigned + ?Sized> DivAssign<&NonZero<Rhs>> for Wrapping<BoxedUint>

Available on crate feature alloc only.
Source§

fn div_assign(&mut self, rhs: &NonZero<Rhs>)

Performs the /= operation. Read more
Source§

impl<const LIMBS: usize> DivAssign<&NonZero<Uint<LIMBS>>> for Int<LIMBS>

Source§

fn div_assign(&mut self, rhs: &NonZero<Uint<LIMBS>>)

Performs the /= operation. Read more
Source§

impl<const LIMBS: usize> DivAssign<&NonZero<Uint<LIMBS>>> for Uint<LIMBS>

Source§

fn div_assign(&mut self, rhs: &NonZero<Uint<LIMBS>>)

Performs the /= operation. Read more
Source§

impl<const LIMBS: usize> DivAssign<&NonZero<Uint<LIMBS>>> for Wrapping<Int<LIMBS>>

Source§

fn div_assign(&mut self, rhs: &NonZero<Uint<LIMBS>>)

Performs the /= operation. Read more
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize> DivAssign<&NonZero<Uint<RHS_LIMBS>>> for Wrapping<Uint<LIMBS>>

Source§

fn div_assign(&mut self, rhs: &NonZero<Uint<RHS_LIMBS>>)

Performs the /= operation. Read more
Source§

impl<const LIMBS: usize> DivAssign<NonZero<Int<LIMBS>>> for Int<LIMBS>

Source§

fn div_assign(&mut self, rhs: NonZero<Int<LIMBS>>)

Performs the /= operation. Read more
Source§

impl<const LIMBS: usize> DivAssign<NonZero<Int<LIMBS>>> for Wrapping<Int<LIMBS>>

Source§

fn div_assign(&mut self, rhs: NonZero<Int<LIMBS>>)

Performs the /= operation. Read more
Source§

impl DivAssign<NonZero<Limb>> for Limb

Source§

fn div_assign(&mut self, rhs: NonZero<Limb>)

Performs the /= operation. Read more
Source§

impl<const LIMBS: usize> DivAssign<NonZero<Limb>> for Uint<LIMBS>

Source§

fn div_assign(&mut self, rhs: NonZero<Limb>)

Performs the /= operation. Read more
Source§

impl<const LIMBS: usize> DivAssign<NonZero<Limb>> for Wrapping<Uint<LIMBS>>

Source§

fn div_assign(&mut self, rhs: NonZero<Limb>)

Performs the /= operation. Read more
Source§

impl<Rhs: AsMut<UintRef>> DivAssign<NonZero<Rhs>> for BoxedUint

Available on crate feature alloc only.
Source§

fn div_assign(&mut self, rhs: NonZero<Rhs>)

Performs the /= operation. Read more
Source§

impl<Rhs: AsMut<UintRef>> DivAssign<NonZero<Rhs>> for Wrapping<BoxedUint>

Available on crate feature alloc only.
Source§

fn div_assign(&mut self, rhs: NonZero<Rhs>)

Performs the /= operation. Read more
Source§

impl<const LIMBS: usize> DivAssign<NonZero<Uint<LIMBS>>> for Int<LIMBS>

Source§

fn div_assign(&mut self, rhs: NonZero<Uint<LIMBS>>)

Performs the /= operation. Read more
Source§

impl<const LIMBS: usize> DivAssign<NonZero<Uint<LIMBS>>> for Uint<LIMBS>

Source§

fn div_assign(&mut self, rhs: NonZero<Uint<LIMBS>>)

Performs the /= operation. Read more
Source§

impl<const LIMBS: usize> DivAssign<NonZero<Uint<LIMBS>>> for Wrapping<Int<LIMBS>>

Source§

fn div_assign(&mut self, rhs: NonZero<Uint<LIMBS>>)

Performs the /= operation. Read more
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize> DivAssign<NonZero<Uint<RHS_LIMBS>>> for Wrapping<Uint<LIMBS>>

Source§

fn div_assign(&mut self, rhs: NonZero<Uint<RHS_LIMBS>>)

Performs the /= operation. Read more
Source§

impl<const LIMBS: usize> FloorSquareRoot for NonZero<Uint<LIMBS>>

Source§

fn floor_sqrt(&self) -> Self

Computes floor(sqrt(self)).
Source§

fn floor_sqrt_vartime(&self) -> Self

Computes floor(sqrt(self)). Read more
Source§

impl<const LIMBS: usize> From<NonZero<u128>> for NonZero<Uint<LIMBS>>

Source§

fn from(integer: NonZeroU128) -> Self

Converts to this type from the input type.
Source§

impl From<NonZero<u16>> for NonZero<Limb>

Source§

fn from(integer: NonZeroU16) -> Self

Converts to this type from the input type.
Source§

impl<const LIMBS: usize> From<NonZero<u16>> for NonZero<Uint<LIMBS>>

Source§

fn from(integer: NonZeroU16) -> Self

Converts to this type from the input type.
Source§

impl From<NonZero<u32>> for NonZero<Limb>

Source§

fn from(integer: NonZeroU32) -> Self

Converts to this type from the input type.
Source§

impl<const LIMBS: usize> From<NonZero<u32>> for NonZero<Uint<LIMBS>>

Source§

fn from(integer: NonZeroU32) -> Self

Converts to this type from the input type.
Source§

impl From<NonZero<u64>> for NonZero<Limb>

Source§

fn from(integer: NonZeroU64) -> Self

Converts to this type from the input type.
Source§

impl<const LIMBS: usize> From<NonZero<u64>> for NonZero<Uint<LIMBS>>

Source§

fn from(integer: NonZeroU64) -> Self

Converts to this type from the input type.
Source§

impl From<NonZero<u8>> for NonZero<Limb>

Source§

fn from(integer: NonZeroU8) -> Self

Converts to this type from the input type.
Source§

impl<const LIMBS: usize> From<NonZero<u8>> for NonZero<Uint<LIMBS>>

Source§

fn from(integer: NonZeroU8) -> Self

Converts to this type from the input type.
Source§

impl<T> From<Odd<T>> for NonZero<T>

Source§

fn from(odd: Odd<T>) -> NonZero<T>

Converts to this type from the input type.
Source§

impl Gcd<BoxedUint> for NonZero<BoxedUint>

Available on crate feature alloc only.
Source§

type Output = NonZero<BoxedUint>

Output type.
Source§

fn gcd(&self, rhs: &BoxedUint) -> Self::Output

Compute the greatest common divisor of self and rhs.
Source§

fn gcd_vartime(&self, rhs: &BoxedUint) -> Self::Output

Compute the greatest common divisor of self and rhs in variable time.
Source§

impl<const LIMBS: usize> Gcd<NonZero<Int<LIMBS>>> for Uint<LIMBS>

Source§

type Output = NonZero<Uint<LIMBS>>

Output type.
Source§

fn gcd(&self, rhs: &NonZeroInt<LIMBS>) -> Self::Output

Compute the greatest common divisor of self and rhs.
Source§

fn gcd_vartime(&self, rhs: &NonZeroInt<LIMBS>) -> Self::Output

Compute the greatest common divisor of self and rhs in variable time.
Source§

impl<const LIMBS: usize> Gcd<NonZero<Uint<LIMBS>>> for Int<LIMBS>

Source§

type Output = NonZero<Uint<LIMBS>>

Output type.
Source§

fn gcd(&self, rhs: &NonZeroUint<LIMBS>) -> Self::Output

Compute the greatest common divisor of self and rhs.
Source§

fn gcd_vartime(&self, rhs: &NonZeroUint<LIMBS>) -> Self::Output

Compute the greatest common divisor of self and rhs in variable time.
Source§

impl<const LIMBS: usize> Gcd<NonZero<Uint<LIMBS>>> for OddUint<LIMBS>

Source§

type Output = Odd<Uint<LIMBS>>

Output type.
Source§

fn gcd(&self, rhs: &NonZeroUint<LIMBS>) -> Self::Output

Compute the greatest common divisor of self and rhs.
Source§

fn gcd_vartime(&self, rhs: &NonZeroUint<LIMBS>) -> Self::Output

Compute the greatest common divisor of self and rhs in variable time.
Source§

impl<const LIMBS: usize> Gcd<NonZero<Uint<LIMBS>>> for Uint<LIMBS>

Source§

type Output = NonZero<Uint<LIMBS>>

Output type.
Source§

fn gcd(&self, rhs: &NonZeroUint<LIMBS>) -> Self::Output

Compute the greatest common divisor of self and rhs.
Source§

fn gcd_vartime(&self, rhs: &NonZeroUint<LIMBS>) -> Self::Output

Compute the greatest common divisor of self and rhs in variable time.
Source§

impl<T: Hash + ?Sized> Hash for NonZero<T>

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<const LIMBS: usize> InvertMod<NonZero<Uint<LIMBS>>> for Int<LIMBS>
where Uint<LIMBS>: InvertMod<Output = Uint<LIMBS>>,

Source§

type Output = Uint<LIMBS>

Output type.
Source§

fn invert_mod(&self, modulus: &NonZero<Uint<LIMBS>>) -> CtOption<Self::Output>

Compute 1 / self mod p.
Source§

impl<T> LowerHex for NonZero<T>
where T: LowerHex + ?Sized,

Source§

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

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

impl<T> Mul for NonZero<T>
where T: Mul<T, Output = T>,

Any non-zero integer multiplied by another non-zero integer is definitionally non-zero.

Source§

type Output = NonZero<T>

The resulting type after applying the * operator.
Source§

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

Performs the * operation. Read more
Source§

impl<T> Octal for NonZero<T>
where T: Octal + ?Sized,

Source§

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

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

impl<T> One for NonZero<T>
where T: One, Self: CtEq,

Source§

fn one() -> Self

Returns the multiplicative identity element of Self, 1.
Source§

fn is_one(&self) -> Choice

Determine if this value is equal to 1. Read more
Source§

fn set_one(&mut self)

Set self to its multiplicative identity, i.e. Self::one.
Source§

fn one_like(_other: &Self) -> Self

Return the value 0 with the same precision as other.
Source§

impl<T> One for NonZero<T>
where T: One + Mul<T, Output = T>,

Source§

fn one() -> Self

Returns the multiplicative identity element of Self, 1. Read more
Source§

fn is_one(&self) -> bool

Returns true if self is equal to the multiplicative identity. Read more
Source§

fn set_one(&mut self)

Sets self to the multiplicative identity element of Self, 1.
Source§

impl<T: Ord + ?Sized> Ord for NonZero<T>

Source§

fn cmp(&self, other: &NonZero<T>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl<T: PartialEq + ?Sized> PartialEq for NonZero<T>

Source§

fn eq(&self, other: &NonZero<T>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · 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<T: PartialOrd + ?Sized> PartialOrd for NonZero<T>

Source§

fn partial_cmp(&self, other: &NonZero<T>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<T> Random for NonZero<T>
where T: Random + Zero + One + CtAssign,

Available on crate feature rand_core only.
Source§

fn try_random_from_rng<R: TryRng + ?Sized>( rng: &mut R, ) -> Result<Self, R::Error>

This uses rejection sampling to avoid zero.

As a result, it runs in variable time. If the generator rng is cryptographically secure (for example, it implements CryptoRng), then this is guaranteed not to leak anything about the output value.

Source§

fn random_from_rng<R: Rng + ?Sized>(rng: &mut R) -> Self

Generate a random value. Read more
Source§

fn try_random() -> Result<Self, Error>

Available on crate feature getrandom only.
Randomly generate a value of this type using the system’s ambient cryptographically secure random number generator. Read more
Source§

fn random() -> Self

Available on crate feature getrandom only.
Randomly generate a value of this type using the system’s ambient cryptographically secure random number generator. Read more
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize> Rem<&NonZero<Int<RHS_LIMBS>>> for &Int<LIMBS>

Source§

type Output = Int<RHS_LIMBS>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: &NonZero<Int<RHS_LIMBS>>) -> Self::Output

Performs the % operation. Read more
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize> Rem<&NonZero<Int<RHS_LIMBS>>> for &Wrapping<Int<LIMBS>>

Source§

type Output = Wrapping<Int<RHS_LIMBS>>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: &NonZero<Int<RHS_LIMBS>>) -> Self::Output

Performs the % operation. Read more
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize> Rem<&NonZero<Int<RHS_LIMBS>>> for Int<LIMBS>

Source§

type Output = Int<RHS_LIMBS>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: &NonZero<Int<RHS_LIMBS>>) -> Self::Output

Performs the % operation. Read more
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize> Rem<&NonZero<Int<RHS_LIMBS>>> for Wrapping<Int<LIMBS>>

Source§

type Output = Wrapping<Int<RHS_LIMBS>>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: &NonZero<Int<RHS_LIMBS>>) -> Self::Output

Performs the % operation. Read more
Source§

impl Rem<&NonZero<Limb>> for &Limb

Source§

type Output = Limb

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: &NonZero<Limb>) -> Limb

Performs the % operation. Read more
Source§

impl<const LIMBS: usize> Rem<&NonZero<Limb>> for &Uint<LIMBS>

Source§

type Output = Limb

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: &NonZero<Limb>) -> Self::Output

Performs the % operation. Read more
Source§

impl<const LIMBS: usize> Rem<&NonZero<Limb>> for &Wrapping<Uint<LIMBS>>

Source§

type Output = Wrapping<Limb>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: &NonZero<Limb>) -> Self::Output

Performs the % operation. Read more
Source§

impl Rem<&NonZero<Limb>> for Limb

Source§

type Output = Limb

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: &NonZero<Limb>) -> Self

Performs the % operation. Read more
Source§

impl<const LIMBS: usize> Rem<&NonZero<Limb>> for Uint<LIMBS>

Source§

type Output = Limb

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: &NonZero<Limb>) -> Self::Output

Performs the % operation. Read more
Source§

impl<const LIMBS: usize> Rem<&NonZero<Limb>> for Wrapping<Uint<LIMBS>>

Source§

type Output = Wrapping<Limb>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: &NonZero<Limb>) -> Self::Output

Performs the % operation. Read more
Source§

impl<Rhs: ToUnsigned + ?Sized> Rem<&NonZero<Rhs>> for &BoxedUint

Available on crate feature alloc only.
Source§

type Output = <Rhs as ToUnsigned>::Unsigned

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: &NonZero<Rhs>) -> Self::Output

Performs the % operation. Read more
Source§

impl<Rhs: ToUnsigned + ?Sized> Rem<&NonZero<Rhs>> for BoxedUint

Available on crate feature alloc only.
Source§

type Output = <Rhs as ToUnsigned>::Unsigned

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: &NonZero<Rhs>) -> Self::Output

Performs the % operation. Read more
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize> Rem<&NonZero<Uint<RHS_LIMBS>>> for &Int<LIMBS>

Source§

type Output = Int<RHS_LIMBS>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: &NonZero<Uint<RHS_LIMBS>>) -> Self::Output

Performs the % operation. Read more
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize> Rem<&NonZero<Uint<RHS_LIMBS>>> for &Uint<LIMBS>

Source§

type Output = Uint<RHS_LIMBS>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: &NonZero<Uint<RHS_LIMBS>>) -> Self::Output

Performs the % operation. Read more
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize> Rem<&NonZero<Uint<RHS_LIMBS>>> for &Wrapping<Int<LIMBS>>

Source§

type Output = Wrapping<Int<RHS_LIMBS>>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: &NonZero<Uint<RHS_LIMBS>>) -> Self::Output

Performs the % operation. Read more
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize> Rem<&NonZero<Uint<RHS_LIMBS>>> for &Wrapping<Uint<LIMBS>>

Source§

type Output = Wrapping<Uint<RHS_LIMBS>>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: &NonZero<Uint<RHS_LIMBS>>) -> Self::Output

Performs the % operation. Read more
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize> Rem<&NonZero<Uint<RHS_LIMBS>>> for Int<LIMBS>

Source§

type Output = Int<RHS_LIMBS>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: &NonZero<Uint<RHS_LIMBS>>) -> Self::Output

Performs the % operation. Read more
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize> Rem<&NonZero<Uint<RHS_LIMBS>>> for Uint<LIMBS>

Source§

type Output = Uint<RHS_LIMBS>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: &NonZero<Uint<RHS_LIMBS>>) -> Self::Output

Performs the % operation. Read more
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize> Rem<&NonZero<Uint<RHS_LIMBS>>> for Wrapping<Int<LIMBS>>

Source§

type Output = Wrapping<Int<RHS_LIMBS>>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: &NonZero<Uint<RHS_LIMBS>>) -> Self::Output

Performs the % operation. Read more
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize> Rem<&NonZero<Uint<RHS_LIMBS>>> for Wrapping<Uint<LIMBS>>

Source§

type Output = Wrapping<Uint<RHS_LIMBS>>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: &NonZero<Uint<RHS_LIMBS>>) -> Self::Output

Performs the % operation. Read more
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize> Rem<NonZero<Int<RHS_LIMBS>>> for &Int<LIMBS>

Source§

type Output = Int<RHS_LIMBS>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: NonZero<Int<RHS_LIMBS>>) -> Self::Output

Performs the % operation. Read more
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize> Rem<NonZero<Int<RHS_LIMBS>>> for &Wrapping<Int<LIMBS>>

Source§

type Output = Wrapping<Int<RHS_LIMBS>>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: NonZero<Int<RHS_LIMBS>>) -> Self::Output

Performs the % operation. Read more
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize> Rem<NonZero<Int<RHS_LIMBS>>> for Int<LIMBS>

Source§

type Output = Int<RHS_LIMBS>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: NonZero<Int<RHS_LIMBS>>) -> Self::Output

Performs the % operation. Read more
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize> Rem<NonZero<Int<RHS_LIMBS>>> for Wrapping<Int<LIMBS>>

Source§

type Output = Wrapping<Int<RHS_LIMBS>>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: NonZero<Int<RHS_LIMBS>>) -> Self::Output

Performs the % operation. Read more
Source§

impl Rem<NonZero<Limb>> for &Limb

Source§

type Output = Limb

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: NonZero<Limb>) -> Limb

Performs the % operation. Read more
Source§

impl<const LIMBS: usize> Rem<NonZero<Limb>> for &Uint<LIMBS>

Source§

type Output = Limb

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: NonZero<Limb>) -> Self::Output

Performs the % operation. Read more
Source§

impl<const LIMBS: usize> Rem<NonZero<Limb>> for &Wrapping<Uint<LIMBS>>

Source§

type Output = Wrapping<Limb>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: NonZero<Limb>) -> Self::Output

Performs the % operation. Read more
Source§

impl Rem<NonZero<Limb>> for Limb

Source§

type Output = Limb

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: NonZero<Limb>) -> Self

Performs the % operation. Read more
Source§

impl<const LIMBS: usize> Rem<NonZero<Limb>> for Uint<LIMBS>

Source§

type Output = Limb

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: NonZero<Limb>) -> Self::Output

Performs the % operation. Read more
Source§

impl<const LIMBS: usize> Rem<NonZero<Limb>> for Wrapping<Uint<LIMBS>>

Source§

type Output = Wrapping<Limb>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: NonZero<Limb>) -> Self::Output

Performs the % operation. Read more
Source§

impl<Rhs: AsMut<UintRef>> Rem<NonZero<Rhs>> for &BoxedUint

Available on crate feature alloc only.
Source§

type Output = Rhs

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: NonZero<Rhs>) -> Self::Output

Performs the % operation. Read more
Source§

impl<Rhs: AsMut<UintRef>> Rem<NonZero<Rhs>> for BoxedUint

Available on crate feature alloc only.
Source§

type Output = Rhs

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: NonZero<Rhs>) -> Self::Output

Performs the % operation. Read more
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize> Rem<NonZero<Uint<RHS_LIMBS>>> for &Int<LIMBS>

Source§

type Output = Int<RHS_LIMBS>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: NonZero<Uint<RHS_LIMBS>>) -> Self::Output

Performs the % operation. Read more
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize> Rem<NonZero<Uint<RHS_LIMBS>>> for &Uint<LIMBS>

Source§

type Output = Uint<RHS_LIMBS>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: NonZero<Uint<RHS_LIMBS>>) -> Self::Output

Performs the % operation. Read more
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize> Rem<NonZero<Uint<RHS_LIMBS>>> for &Wrapping<Int<LIMBS>>

Source§

type Output = Wrapping<Int<RHS_LIMBS>>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: NonZero<Uint<RHS_LIMBS>>) -> Self::Output

Performs the % operation. Read more
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize> Rem<NonZero<Uint<RHS_LIMBS>>> for &Wrapping<Uint<LIMBS>>

Source§

type Output = Wrapping<Uint<RHS_LIMBS>>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: NonZero<Uint<RHS_LIMBS>>) -> Self::Output

Performs the % operation. Read more
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize> Rem<NonZero<Uint<RHS_LIMBS>>> for Int<LIMBS>

Source§

type Output = Int<RHS_LIMBS>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: NonZero<Uint<RHS_LIMBS>>) -> Self::Output

Performs the % operation. Read more
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize> Rem<NonZero<Uint<RHS_LIMBS>>> for Uint<LIMBS>

Source§

type Output = Uint<RHS_LIMBS>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: NonZero<Uint<RHS_LIMBS>>) -> Self::Output

Performs the % operation. Read more
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize> Rem<NonZero<Uint<RHS_LIMBS>>> for Wrapping<Int<LIMBS>>

Source§

type Output = Wrapping<Int<RHS_LIMBS>>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: NonZero<Uint<RHS_LIMBS>>) -> Self::Output

Performs the % operation. Read more
Source§

impl<const LIMBS: usize, const RHS_LIMBS: usize> Rem<NonZero<Uint<RHS_LIMBS>>> for Wrapping<Uint<LIMBS>>

Source§

type Output = Wrapping<Uint<RHS_LIMBS>>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: NonZero<Uint<RHS_LIMBS>>) -> Self::Output

Performs the % operation. Read more
Source§

impl<const LIMBS: usize> RemAssign<&NonZero<Int<LIMBS>>> for Int<LIMBS>

Source§

fn rem_assign(&mut self, rhs: &NonZero<Int<LIMBS>>)

Performs the %= operation. Read more
Source§

impl<const LIMBS: usize> RemAssign<&NonZero<Int<LIMBS>>> for Wrapping<Int<LIMBS>>

Source§

fn rem_assign(&mut self, rhs: &NonZero<Int<LIMBS>>)

Performs the %= operation. Read more
Source§

impl RemAssign<&NonZero<Limb>> for Limb

Source§

fn rem_assign(&mut self, rhs: &NonZero<Limb>)

Performs the %= operation. Read more
Source§

impl<const LIMBS: usize> RemAssign<&NonZero<Limb>> for Uint<LIMBS>

Source§

fn rem_assign(&mut self, rhs: &NonZero<Limb>)

Performs the %= operation. Read more
Source§

impl<const LIMBS: usize> RemAssign<&NonZero<Limb>> for Wrapping<Uint<LIMBS>>

Source§

fn rem_assign(&mut self, rhs: &NonZero<Limb>)

Performs the %= operation. Read more
Source§

impl<Rhs: AsRef<UintRef> + ?Sized> RemAssign<&NonZero<Rhs>> for BoxedUint

Available on crate feature alloc only.
Source§

fn rem_assign(&mut self, rhs: &NonZero<Rhs>)

Performs the %= operation. Read more
Source§

impl<const LIMBS: usize> RemAssign<&NonZero<Uint<LIMBS>>> for Int<LIMBS>

Source§

fn rem_assign(&mut self, rhs: &NonZero<Uint<LIMBS>>)

Performs the %= operation. Read more
Source§

impl<const LIMBS: usize> RemAssign<&NonZero<Uint<LIMBS>>> for Uint<LIMBS>

Source§

fn rem_assign(&mut self, rhs: &NonZero<Uint<LIMBS>>)

Performs the %= operation. Read more
Source§

impl<const LIMBS: usize> RemAssign<&NonZero<Uint<LIMBS>>> for Wrapping<Int<LIMBS>>

Source§

fn rem_assign(&mut self, rhs: &NonZero<Uint<LIMBS>>)

Performs the %= operation. Read more
Source§

impl<const LIMBS: usize> RemAssign<&NonZero<Uint<LIMBS>>> for Wrapping<Uint<LIMBS>>

Source§

fn rem_assign(&mut self, rhs: &NonZero<Uint<LIMBS>>)

Performs the %= operation. Read more
Source§

impl<const LIMBS: usize> RemAssign<NonZero<Int<LIMBS>>> for Int<LIMBS>

Source§

fn rem_assign(&mut self, rhs: NonZero<Int<LIMBS>>)

Performs the %= operation. Read more
Source§

impl<const LIMBS: usize> RemAssign<NonZero<Int<LIMBS>>> for Wrapping<Int<LIMBS>>

Source§

fn rem_assign(&mut self, rhs: NonZero<Int<LIMBS>>)

Performs the %= operation. Read more
Source§

impl RemAssign<NonZero<Limb>> for Limb

Source§

fn rem_assign(&mut self, rhs: NonZero<Limb>)

Performs the %= operation. Read more
Source§

impl<const LIMBS: usize> RemAssign<NonZero<Limb>> for Uint<LIMBS>

Source§

fn rem_assign(&mut self, rhs: NonZero<Limb>)

Performs the %= operation. Read more
Source§

impl<const LIMBS: usize> RemAssign<NonZero<Limb>> for Wrapping<Uint<LIMBS>>

Source§

fn rem_assign(&mut self, rhs: NonZero<Limb>)

Performs the %= operation. Read more
Source§

impl<Rhs: AsRef<UintRef>> RemAssign<NonZero<Rhs>> for BoxedUint

Available on crate feature alloc only.
Source§

fn rem_assign(&mut self, rhs: NonZero<Rhs>)

Performs the %= operation. Read more
Source§

impl<const LIMBS: usize> RemAssign<NonZero<Uint<LIMBS>>> for Int<LIMBS>

Source§

fn rem_assign(&mut self, rhs: NonZero<Uint<LIMBS>>)

Performs the %= operation. Read more
Source§

impl<const LIMBS: usize> RemAssign<NonZero<Uint<LIMBS>>> for Uint<LIMBS>

Source§

fn rem_assign(&mut self, rhs: NonZero<Uint<LIMBS>>)

Performs the %= operation. Read more
Source§

impl<const LIMBS: usize> RemAssign<NonZero<Uint<LIMBS>>> for Wrapping<Int<LIMBS>>

Source§

fn rem_assign(&mut self, rhs: NonZero<Uint<LIMBS>>)

Performs the %= operation. Read more
Source§

impl<const LIMBS: usize> RemAssign<NonZero<Uint<LIMBS>>> for Wrapping<Uint<LIMBS>>

Source§

fn rem_assign(&mut self, rhs: NonZero<Uint<LIMBS>>)

Performs the %= operation. Read more
Source§

impl Resize for &NonZero<BoxedUint>

Available on crate feature alloc only.
Source§

type Output = NonZero<BoxedUint>

The result of the resizing.
Source§

fn resize_unchecked(self, at_least_bits_precision: u32) -> Self::Output

Resizes to the minimum storage that fits at_least_bits_precision without checking if the bit size of self is larger than at_least_bits_precision. Read more
Source§

fn try_resize(self, at_least_bits_precision: u32) -> Option<Self::Output>

Resizes to the minimum storage that fits at_least_bits_precision returning None if the bit size of self is larger than at_least_bits_precision. Read more
Source§

fn resize(self, at_least_bits_precision: u32) -> Self::Output

Resizes to the minimum storage that fits at_least_bits_precision panicking if the bit size of self is larger than at_least_bits_precision. Read more
Source§

impl Resize for NonZero<BoxedUint>

Available on crate feature alloc only.
Source§

type Output = NonZero<BoxedUint>

The result of the resizing.
Source§

fn resize_unchecked(self, at_least_bits_precision: u32) -> Self::Output

Resizes to the minimum storage that fits at_least_bits_precision without checking if the bit size of self is larger than at_least_bits_precision. Read more
Source§

fn try_resize(self, at_least_bits_precision: u32) -> Option<Self::Output>

Resizes to the minimum storage that fits at_least_bits_precision returning None if the bit size of self is larger than at_least_bits_precision. Read more
Source§

fn resize(self, at_least_bits_precision: u32) -> Self::Output

Resizes to the minimum storage that fits at_least_bits_precision panicking if the bit size of self is larger than at_least_bits_precision. Read more
Source§

impl<T: Serialize + Zero> Serialize for NonZero<T>

Available on crate feature serde only.
Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<T> UpperHex for NonZero<T>
where T: UpperHex + ?Sized,

Source§

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

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

impl<T: Zeroize + Zero> Zeroize for NonZero<T>

Available on crate feature zeroize only.
Source§

fn zeroize(&mut self)

Zero out this object from memory using Rust intrinsics which ensure the zeroization operation is not “optimized away” by the compiler.
Source§

impl<T: Copy + ?Sized> Copy for NonZero<T>

Source§

impl<T: Eq + ?Sized> Eq for NonZero<T>

Source§

impl<T: ?Sized> StructuralPartialEq for NonZero<T>

Auto Trait Implementations§

§

impl<T> Freeze for NonZero<T>
where T: Freeze + ?Sized,

§

impl<T> RefUnwindSafe for NonZero<T>
where T: RefUnwindSafe + ?Sized,

§

impl<T> Send for NonZero<T>
where T: Send + ?Sized,

§

impl<T> Sync for NonZero<T>
where T: Sync + ?Sized,

§

impl<T> Unpin for NonZero<T>
where T: Unpin + ?Sized,

§

impl<T> UnsafeUnpin for NonZero<T>
where T: UnsafeUnpin + ?Sized,

§

impl<T> UnwindSafe for NonZero<T>
where T: UnwindSafe + ?Sized,

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, const N: usize> CtSelectArray<N> for T

Source§

fn ct_select_array(a: &[T; N], b: &[T; N], choice: Choice) -> [T; N]

Select between a and b in constant-time based on choice.
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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,