pub trait UnsignedModularInt:
Zeroize
+ Clone
+ PartialOrd
+ IntegerResize<Output = Self>
+ TryFromBeBytes {
type Bytes: NumBytes + AsMut<[u8]>;
// Required methods
fn to_be_bytes(&self) -> Self::Bytes;
fn as_nz_ref(&self) -> NonZero<Self>;
fn bits(&self) -> u32;
fn bits_precision(&self) -> u32;
fn to_be_bytes_trimmed_vartime(&self) -> Box<[u8]>;
}Required Associated Types§
Required Methods§
fn to_be_bytes(&self) -> Self::Bytes
fn as_nz_ref(&self) -> NonZero<Self>
Sourcefn bits(&self) -> u32
fn bits(&self) -> u32
Bit length of the value (position of the highest set bit; 0 for
zero). A value-defined primitive on purpose: no
leading_zeros-style container-relative accessor lives on this
trait, so runtime-length carriers can satisfy it without
committing to any notion of “width”.
fn bits_precision(&self) -> u32
fn to_be_bytes_trimmed_vartime(&self) -> Box<[u8]>
Available on crate feature
alloc only.Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
Source§impl UnsignedModularInt for BoxedUint
Available on crate feature alloc only.
impl UnsignedModularInt for BoxedUint
Available on crate feature
alloc only.Source§impl<T> UnsignedModularInt for ModMathValue<T>where
T: FixedWidthUnsignedInt + PartialOrd,
Available on crate features alloc and modmath only.
impl<T> UnsignedModularInt for ModMathValue<T>where
T: FixedWidthUnsignedInt + PartialOrd,
Available on crate features
alloc and modmath only.