Skip to main content

FixedWidthUnsignedInt

Trait FixedWidthUnsignedInt 

Source
pub trait FixedWidthUnsignedInt:
    Zeroize
    + Clone
    + Copy {
    type Bytes: NumBytes + Default + AsMut<[u8]>;

    // Required methods
    fn leading_zeros(&self) -> u32;
    fn to_be_bytes(&self) -> Self::Bytes;
    fn try_from_be_bytes_vartime(bytes: &[u8]) -> Result<Self>;
    fn bits_precision(&self) -> u32;
}

Required Associated Types§

Source

type Bytes: NumBytes + Default + AsMut<[u8]>

Required Methods§

Source

fn leading_zeros(&self) -> u32

Source

fn to_be_bytes(&self) -> Self::Bytes

Source

fn try_from_be_bytes_vartime(bytes: &[u8]) -> Result<Self>

Source

fn bits_precision(&self) -> u32

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<T> FixedWidthUnsignedInt for T
where T: Zeroize + Clone + Copy + PrimInt + NumToBytes + NumFromBytes + NumToBytes<Bytes = <T as NumFromBytes>::Bytes>, <T as NumToBytes>::Bytes: NumBytes + Default + AsMut<[u8]>,

Source§

type Bytes = <T as ToBytes>::Bytes