Struct crypto_bigint::NonZero
source · [−]pub struct NonZero<T: Zero>(_);Expand description
Wrapper type for non-zero integers.
Implementations
sourceimpl<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.
sourceimpl<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>
Available on crate feature generic-array only.
pub fn from_be_byte_array(bytes: ByteArray<T>) -> CtOption<Self>
generic-array only.Decode a non-zero integer from big endian bytes.
sourcepub fn from_le_byte_array(bytes: ByteArray<T>) -> CtOption<Self>
Available on crate feature generic-array only.
pub fn from_le_byte_array(bytes: ByteArray<T>) -> CtOption<Self>
generic-array only.Decode a non-zero integer from big endian bytes.
sourceimpl 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)
sourceimpl<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
sourceimpl<T> ConditionallySelectable for NonZero<T>where
T: ConditionallySelectable + Zero,
impl<T> ConditionallySelectable for NonZero<T>where
T: ConditionallySelectable + Zero,
sourcefn conditional_select(a: &Self, b: &Self, choice: Choice) -> Self
fn conditional_select(a: &Self, b: &Self, choice: Choice) -> Self
sourcefn conditional_assign(&mut self, other: &Self, choice: Choice)
fn conditional_assign(&mut self, other: &Self, choice: Choice)
sourceimpl<T> ConstantTimeEq for NonZero<T>where
T: Zero,
impl<T> ConstantTimeEq for NonZero<T>where
T: Zero,
sourceimpl<'de, T: Deserialize<'de> + Zero> Deserialize<'de> for NonZero<T>
Available on crate feature serde only.
impl<'de, T: Deserialize<'de> + Zero> Deserialize<'de> for NonZero<T>
Available on crate feature
serde only.sourcefn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl<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,
sourceimpl<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,
sourceimpl<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,
sourceimpl<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,
sourcefn div_assign(&mut self, rhs: &NonZero<UInt<LIMBS>>)
fn div_assign(&mut self, rhs: &NonZero<UInt<LIMBS>>)
Performs the
/= operation. Read moresourceimpl<const LIMBS: usize> DivAssign<&NonZero<UInt<LIMBS>>> for Wrapping<UInt<LIMBS>>
impl<const LIMBS: usize> DivAssign<&NonZero<UInt<LIMBS>>> for Wrapping<UInt<LIMBS>>
sourcefn div_assign(&mut self, rhs: &NonZero<UInt<LIMBS>>)
fn div_assign(&mut self, rhs: &NonZero<UInt<LIMBS>>)
Performs the
/= operation. Read moresourceimpl<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,
sourcefn div_assign(&mut self, rhs: NonZero<UInt<LIMBS>>)
fn div_assign(&mut self, rhs: NonZero<UInt<LIMBS>>)
Performs the
/= operation. Read moresourceimpl<const LIMBS: usize> DivAssign<NonZero<UInt<LIMBS>>> for Wrapping<UInt<LIMBS>>
impl<const LIMBS: usize> DivAssign<NonZero<UInt<LIMBS>>> for Wrapping<UInt<LIMBS>>
sourcefn div_assign(&mut self, rhs: NonZero<UInt<LIMBS>>)
fn div_assign(&mut self, rhs: NonZero<UInt<LIMBS>>)
Performs the
/= operation. Read moresourceimpl<const LIMBS: usize> From<NonZeroU128> for NonZero<UInt<LIMBS>>
impl<const LIMBS: usize> From<NonZeroU128> for NonZero<UInt<LIMBS>>
sourcefn from(integer: NonZeroU128) -> Self
fn from(integer: NonZeroU128) -> Self
Converts to this type from the input type.
sourceimpl From<NonZeroU16> for NonZero<Limb>
impl From<NonZeroU16> for NonZero<Limb>
sourcefn from(integer: NonZeroU16) -> Self
fn from(integer: NonZeroU16) -> Self
Converts to this type from the input type.
sourceimpl<const LIMBS: usize> From<NonZeroU16> for NonZero<UInt<LIMBS>>
impl<const LIMBS: usize> From<NonZeroU16> for NonZero<UInt<LIMBS>>
sourcefn from(integer: NonZeroU16) -> Self
fn from(integer: NonZeroU16) -> Self
Converts to this type from the input type.
sourceimpl From<NonZeroU32> for NonZero<Limb>
impl From<NonZeroU32> for NonZero<Limb>
sourcefn from(integer: NonZeroU32) -> Self
fn from(integer: NonZeroU32) -> Self
Converts to this type from the input type.
sourceimpl<const LIMBS: usize> From<NonZeroU32> for NonZero<UInt<LIMBS>>
impl<const LIMBS: usize> From<NonZeroU32> for NonZero<UInt<LIMBS>>
sourcefn from(integer: NonZeroU32) -> Self
fn from(integer: NonZeroU32) -> Self
Converts to this type from the input type.
sourceimpl<const LIMBS: usize> From<NonZeroU64> for NonZero<UInt<LIMBS>>
impl<const LIMBS: usize> From<NonZeroU64> for NonZero<UInt<LIMBS>>
sourcefn from(integer: NonZeroU64) -> Self
fn from(integer: NonZeroU64) -> Self
Converts to this type from the input type.
sourceimpl<T: Ord + Zero> Ord for NonZero<T>
impl<T: Ord + Zero> Ord for NonZero<T>
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl<T: PartialEq + Zero> PartialEq<NonZero<T>> for NonZero<T>
impl<T: PartialEq + Zero> PartialEq<NonZero<T>> for NonZero<T>
sourceimpl<T: PartialOrd + Zero> PartialOrd<NonZero<T>> for NonZero<T>
impl<T: PartialOrd + Zero> PartialOrd<NonZero<T>> for NonZero<T>
sourcefn partial_cmp(&self, other: &NonZero<T>) -> Option<Ordering>
fn partial_cmp(&self, other: &NonZero<T>) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moresourceimpl<T> Random for NonZero<T>where
T: Random + Zero,
Available on crate feature rand_core only.
impl<T> Random for NonZero<T>where
T: Random + Zero,
Available on crate feature
rand_core only.sourceimpl<const LIMBS: usize> Rem<&NonZero<UInt<LIMBS>>> for &UInt<LIMBS>where
UInt<LIMBS>: Integer,
impl<const LIMBS: usize> Rem<&NonZero<UInt<LIMBS>>> for &UInt<LIMBS>where
UInt<LIMBS>: Integer,
sourceimpl<const LIMBS: usize> Rem<&NonZero<UInt<LIMBS>>> for UInt<LIMBS>where
UInt<LIMBS>: Integer,
impl<const LIMBS: usize> Rem<&NonZero<UInt<LIMBS>>> for UInt<LIMBS>where
UInt<LIMBS>: Integer,
sourceimpl<const LIMBS: usize> Rem<NonZero<UInt<LIMBS>>> for &UInt<LIMBS>where
UInt<LIMBS>: Integer,
impl<const LIMBS: usize> Rem<NonZero<UInt<LIMBS>>> for &UInt<LIMBS>where
UInt<LIMBS>: Integer,
sourceimpl<const LIMBS: usize> RemAssign<&NonZero<UInt<LIMBS>>> for UInt<LIMBS>where
UInt<LIMBS>: Integer,
impl<const LIMBS: usize> RemAssign<&NonZero<UInt<LIMBS>>> for UInt<LIMBS>where
UInt<LIMBS>: Integer,
sourcefn rem_assign(&mut self, rhs: &NonZero<UInt<LIMBS>>)
fn rem_assign(&mut self, rhs: &NonZero<UInt<LIMBS>>)
Performs the
%= operation. Read moresourceimpl<const LIMBS: usize> RemAssign<&NonZero<UInt<LIMBS>>> for Wrapping<UInt<LIMBS>>
impl<const LIMBS: usize> RemAssign<&NonZero<UInt<LIMBS>>> for Wrapping<UInt<LIMBS>>
sourcefn rem_assign(&mut self, rhs: &NonZero<UInt<LIMBS>>)
fn rem_assign(&mut self, rhs: &NonZero<UInt<LIMBS>>)
Performs the
%= operation. Read moresourceimpl<const LIMBS: usize> RemAssign<NonZero<UInt<LIMBS>>> for UInt<LIMBS>where
UInt<LIMBS>: Integer,
impl<const LIMBS: usize> RemAssign<NonZero<UInt<LIMBS>>> for UInt<LIMBS>where
UInt<LIMBS>: Integer,
sourcefn rem_assign(&mut self, rhs: NonZero<UInt<LIMBS>>)
fn rem_assign(&mut self, rhs: NonZero<UInt<LIMBS>>)
Performs the
%= operation. Read moresourceimpl<const LIMBS: usize> RemAssign<NonZero<UInt<LIMBS>>> for Wrapping<UInt<LIMBS>>
impl<const LIMBS: usize> RemAssign<NonZero<UInt<LIMBS>>> for Wrapping<UInt<LIMBS>>
sourcefn rem_assign(&mut self, rhs: NonZero<UInt<LIMBS>>)
fn rem_assign(&mut self, rhs: NonZero<UInt<LIMBS>>)
Performs the
%= operation. Read moreimpl<T: Copy + Zero> Copy for NonZero<T>
impl<T: Eq + Zero> Eq for NonZero<T>
impl<T: Zero> StructuralEq for NonZero<T>
impl<T: Zero> StructuralPartialEq for NonZero<T>
Auto Trait Implementations
impl<T> RefUnwindSafe for NonZero<T>where
T: RefUnwindSafe,
impl<T> Send for NonZero<T>where
T: Send,
impl<T> Sync for NonZero<T>where
T: Sync,
impl<T> Unpin for NonZero<T>where
T: Unpin,
impl<T> UnwindSafe for NonZero<T>where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more