Struct crypto_bigint::NonZero
source · [−]pub struct NonZero<T: Integer>(_);
Expand description
Wrapper type for non-zero integers.
Implementations
sourceimpl<T> NonZero<T> where
T: Integer,
impl<T> NonZero<T> where
T: Integer,
sourcepub fn from_be_bytes(bytes: T::Repr) -> CtOption<Self> where
T: Encoding,
pub fn from_be_bytes(bytes: T::Repr) -> CtOption<Self> where
T: Encoding,
Decode from big endian bytes.
sourcepub fn from_le_bytes(bytes: T::Repr) -> CtOption<Self> where
T: Encoding,
pub fn from_le_bytes(bytes: T::Repr) -> CtOption<Self> where
T: Encoding,
Decode from little endian bytes.
sourcepub fn from_be_byte_array(bytes: ByteArray<T>) -> CtOption<Self> where
T: ArrayEncoding,
pub fn from_be_byte_array(bytes: ByteArray<T>) -> CtOption<Self> where
T: ArrayEncoding,
Decode a non-zero integer from big endian bytes.
sourcepub fn from_le_byte_array(bytes: ByteArray<T>) -> CtOption<Self> where
T: ArrayEncoding,
pub fn from_le_byte_array(bytes: ByteArray<T>) -> CtOption<Self> where
T: ArrayEncoding,
Decode a non-zero integer from big endian bytes.
sourceimpl<const LIMBS: usize> NonZero<UInt<LIMBS>> where
UInt<LIMBS>: Integer,
impl<const LIMBS: usize> NonZero<UInt<LIMBS>> where
UInt<LIMBS>: Integer,
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: Integer,
impl<T> ConditionallySelectable for NonZero<T> where
T: Integer,
sourceimpl<T> ConstantTimeEq for NonZero<T> where
T: Integer,
impl<T> ConstantTimeEq for NonZero<T> where
T: 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> 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 more
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 more
sourceimpl<const LIMBS: usize> From<NonZeroU128> for NonZero<UInt<LIMBS>> where
UInt<LIMBS>: Integer,
impl<const LIMBS: usize> From<NonZeroU128> for NonZero<UInt<LIMBS>> where
UInt<LIMBS>: Integer,
sourcefn from(integer: NonZeroU128) -> Self
fn from(integer: NonZeroU128) -> Self
Converts to this type from the input type.
sourceimpl<const LIMBS: usize> From<NonZeroU16> for NonZero<UInt<LIMBS>> where
UInt<LIMBS>: Integer,
impl<const LIMBS: usize> From<NonZeroU16> for NonZero<UInt<LIMBS>> where
UInt<LIMBS>: Integer,
sourcefn from(integer: NonZeroU16) -> Self
fn from(integer: NonZeroU16) -> Self
Converts to this type from the input type.
sourceimpl<const LIMBS: usize> From<NonZeroU32> for NonZero<UInt<LIMBS>> where
UInt<LIMBS>: Integer,
impl<const LIMBS: usize> From<NonZeroU32> for NonZero<UInt<LIMBS>> where
UInt<LIMBS>: Integer,
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>> where
UInt<LIMBS>: Integer,
impl<const LIMBS: usize> From<NonZeroU64> for NonZero<UInt<LIMBS>> where
UInt<LIMBS>: Integer,
sourcefn from(integer: NonZeroU64) -> Self
fn from(integer: NonZeroU64) -> Self
Converts to this type from the input type.
sourceimpl<T: Ord + Integer> Ord for NonZero<T>
impl<T: Ord + Integer> Ord for NonZero<T>
sourceimpl<T: PartialOrd + Integer> PartialOrd<NonZero<T>> for NonZero<T>
impl<T: PartialOrd + Integer> PartialOrd<NonZero<T>> for NonZero<T>
sourcefn partial_cmp(&self, other: &NonZero<T>) -> Option<Ordering>
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 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
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 more
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> 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 more
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 more
impl<T: Copy + Integer> Copy for NonZero<T>
impl<T: Eq + Integer> Eq for NonZero<T>
impl<T: Integer> StructuralEq for NonZero<T>
impl<T: Integer> StructuralPartialEq for NonZero<T>
Auto Trait Implementations
impl<T> RefUnwindSafe for NonZero<T> where
T: RefUnwindSafe,
impl<T> Send for NonZero<T>
impl<T> Sync for NonZero<T>
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 T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more