Struct crypto_bigint::NonZero
source · pub struct NonZero<T: Zero>(_);
Expand description
Wrapper type for non-zero integers.
Implementations§
source§impl<T> NonZero<T>where
T: Encoding + Zero,
impl<T> NonZero<T>where T: Encoding + Zero,
sourcepub fn from_be_bytes(bytes: T::Repr) -> CtOption<Self>
pub fn from_be_bytes(bytes: T::Repr) -> CtOption<Self>
Decode from big endian bytes.
sourcepub fn from_le_bytes(bytes: T::Repr) -> CtOption<Self>
pub fn from_le_bytes(bytes: T::Repr) -> CtOption<Self>
Decode from little endian bytes.
source§impl<T> NonZero<T>where
T: ArrayEncoding + Zero,
impl<T> NonZero<T>where T: ArrayEncoding + Zero,
sourcepub fn from_be_byte_array(bytes: ByteArray<T>) -> CtOption<Self>
pub fn from_be_byte_array(bytes: ByteArray<T>) -> CtOption<Self>
Decode a non-zero integer from big endian bytes.
sourcepub fn from_le_byte_array(bytes: ByteArray<T>) -> CtOption<Self>
pub fn from_le_byte_array(bytes: ByteArray<T>) -> CtOption<Self>
Decode a non-zero integer from big endian bytes.
source§impl NonZero<Limb>
impl NonZero<Limb>
sourcepub const fn from_u8(n: NonZeroU8) -> Self
pub const fn from_u8(n: NonZeroU8) -> Self
Create a NonZero<Limb>
from a NonZeroU8
(const-friendly)
sourcepub const fn from_u16(n: NonZeroU16) -> Self
pub const fn from_u16(n: NonZeroU16) -> Self
Create a NonZero<Limb>
from a NonZeroU16
(const-friendly)
sourcepub const fn from_u32(n: NonZeroU32) -> Self
pub const fn from_u32(n: NonZeroU32) -> Self
Create a NonZero<Limb>
from a NonZeroU32
(const-friendly)
sourcepub const fn from_u64(n: NonZeroU64) -> Self
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>>
impl<const LIMBS: usize> NonZero<UInt<LIMBS>>
sourcepub const fn from_uint(n: UInt<LIMBS>) -> Self
pub const fn from_uint(n: UInt<LIMBS>) -> Self
Create a NonZero<UInt>
from a UInt
(const-friendly)
sourcepub const fn from_u8(n: NonZeroU8) -> Self
pub const fn from_u8(n: NonZeroU8) -> Self
Create a NonZero<UInt>
from a NonZeroU8
(const-friendly)
sourcepub const fn from_u16(n: NonZeroU16) -> Self
pub const fn from_u16(n: NonZeroU16) -> Self
Create a NonZero<UInt>
from a NonZeroU16
(const-friendly)
sourcepub const fn from_u32(n: NonZeroU32) -> Self
pub const fn from_u32(n: NonZeroU32) -> Self
Create a NonZero<UInt>
from a NonZeroU32
(const-friendly)
sourcepub const fn from_u64(n: NonZeroU64) -> Self
pub const fn from_u64(n: NonZeroU64) -> Self
Create a NonZero<UInt>
from a NonZeroU64
(const-friendly)
sourcepub const fn from_u128(n: NonZeroU128) -> Self
pub const fn from_u128(n: NonZeroU128) -> Self
Create a NonZero<UInt>
from a NonZeroU128
(const-friendly)
Trait Implementations§
source§impl<T> ConditionallySelectable for NonZero<T>where
T: ConditionallySelectable + Zero,
impl<T> ConditionallySelectable for NonZero<T>where T: ConditionallySelectable + Zero,
source§impl<T> ConstantTimeEq for NonZero<T>where
T: Zero,
impl<T> ConstantTimeEq for NonZero<T>where T: Zero,
source§impl<const LIMBS: usize> Div<&NonZero<UInt<LIMBS>>> for &UInt<LIMBS>where
UInt<LIMBS>: Integer,
impl<const LIMBS: usize> Div<&NonZero<UInt<LIMBS>>> for &UInt<LIMBS>where UInt<LIMBS>: Integer,
source§impl<const LIMBS: usize> Div<&NonZero<UInt<LIMBS>>> for UInt<LIMBS>where
UInt<LIMBS>: Integer,
impl<const LIMBS: usize> Div<&NonZero<UInt<LIMBS>>> for UInt<LIMBS>where UInt<LIMBS>: Integer,
source§impl<const LIMBS: usize> Div<NonZero<UInt<LIMBS>>> for &UInt<LIMBS>where
UInt<LIMBS>: Integer,
impl<const LIMBS: usize> Div<NonZero<UInt<LIMBS>>> for &UInt<LIMBS>where UInt<LIMBS>: Integer,
source§impl<const LIMBS: usize> Div<NonZero<UInt<LIMBS>>> for UInt<LIMBS>where
UInt<LIMBS>: Integer,
impl<const LIMBS: usize> Div<NonZero<UInt<LIMBS>>> for UInt<LIMBS>where UInt<LIMBS>: Integer,
source§impl<const LIMBS: usize> DivAssign<&NonZero<UInt<LIMBS>>> for UInt<LIMBS>where
UInt<LIMBS>: Integer,
impl<const LIMBS: usize> DivAssign<&NonZero<UInt<LIMBS>>> for UInt<LIMBS>where UInt<LIMBS>: Integer,
source§impl<const LIMBS: usize> DivAssign<NonZero<UInt<LIMBS>>> for UInt<LIMBS>where
UInt<LIMBS>: Integer,
impl<const LIMBS: usize> DivAssign<NonZero<UInt<LIMBS>>> for UInt<LIMBS>where UInt<LIMBS>: Integer,
source§impl<const LIMBS: usize> From<NonZeroU128> for NonZero<UInt<LIMBS>>
impl<const LIMBS: usize> From<NonZeroU128> for NonZero<UInt<LIMBS>>
source§fn from(integer: NonZeroU128) -> Self
fn from(integer: NonZeroU128) -> Self
source§impl From<NonZeroU16> for NonZero<Limb>
impl From<NonZeroU16> for NonZero<Limb>
source§fn from(integer: NonZeroU16) -> Self
fn from(integer: NonZeroU16) -> Self
source§impl<const LIMBS: usize> From<NonZeroU16> for NonZero<UInt<LIMBS>>
impl<const LIMBS: usize> From<NonZeroU16> for NonZero<UInt<LIMBS>>
source§fn from(integer: NonZeroU16) -> Self
fn from(integer: NonZeroU16) -> Self
source§impl From<NonZeroU32> for NonZero<Limb>
impl From<NonZeroU32> for NonZero<Limb>
source§fn from(integer: NonZeroU32) -> Self
fn from(integer: NonZeroU32) -> Self
source§impl<const LIMBS: usize> From<NonZeroU32> for NonZero<UInt<LIMBS>>
impl<const LIMBS: usize> From<NonZeroU32> for NonZero<UInt<LIMBS>>
source§fn from(integer: NonZeroU32) -> Self
fn from(integer: NonZeroU32) -> Self
source§impl From<NonZeroU64> for NonZero<Limb>
impl From<NonZeroU64> for NonZero<Limb>
source§fn from(integer: NonZeroU64) -> Self
fn from(integer: NonZeroU64) -> Self
source§impl<const LIMBS: usize> From<NonZeroU64> for NonZero<UInt<LIMBS>>
impl<const LIMBS: usize> From<NonZeroU64> for NonZero<UInt<LIMBS>>
source§fn from(integer: NonZeroU64) -> Self
fn from(integer: NonZeroU64) -> Self
source§impl<T: Ord + Zero> Ord for NonZero<T>
impl<T: Ord + Zero> Ord for NonZero<T>
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
source§impl<T: PartialEq + Zero> PartialEq<NonZero<T>> for NonZero<T>
impl<T: PartialEq + Zero> PartialEq<NonZero<T>> for NonZero<T>
source§impl<T: PartialOrd + Zero> PartialOrd<NonZero<T>> for NonZero<T>
impl<T: PartialOrd + Zero> PartialOrd<NonZero<T>> for NonZero<T>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more