Word

Trait Word 

Source
pub trait Word:
    PartialEq
    + Debug
    + Copy
    + WrappingAdd
    + WrappingSub
    + WrappingShl
    + WrappingShr
    + BitAnd<Output = Self>
    + BitOr<Output = Self>
    + BitXor<Output = Self>
    + Shl<Output = Self>
    + Shr<Output = Self> {
    const ZERO: Self;
    const BYTES: usize;
    const P: Self;
    const Q: Self;

    // Required methods
    fn from_usize(val: usize) -> Self;
    fn from_u8(val: u8) -> Self;
}

Required Associated Constants§

Source

const ZERO: Self

Source

const BYTES: usize

Source

const P: Self

Source

const Q: Self

Required Methods§

Source

fn from_usize(val: usize) -> Self

Source

fn from_u8(val: u8) -> Self

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Word for u8

Source§

const ZERO: Self = 0u8

Source§

const BYTES: usize = 1usize

Source§

const P: Self = 183u8

Source§

const Q: Self = 159u8

Source§

fn from_usize(val: usize) -> Self

Source§

fn from_u8(val: u8) -> Self

Source§

impl Word for u16

Source§

const ZERO: Self = 0u16

Source§

const BYTES: usize = 2usize

Source§

const P: Self = 47_073u16

Source§

const Q: Self = 40_503u16

Source§

fn from_usize(val: usize) -> Self

Source§

fn from_u8(val: u8) -> Self

Source§

impl Word for u32

Source§

const ZERO: Self = 0u32

Source§

const BYTES: usize = 4usize

Source§

const P: Self = 3_084_996_963u32

Source§

const Q: Self = 2_654_435_769u32

Source§

fn from_usize(val: usize) -> Self

Source§

fn from_u8(val: u8) -> Self

Source§

impl Word for u64

Source§

const ZERO: Self = 0u64

Source§

const BYTES: usize = 8usize

Source§

const P: Self = 13_249_961_062_380_153_451u64

Source§

const Q: Self = 11_400_714_819_323_198_485u64

Source§

fn from_usize(val: usize) -> Self

Source§

fn from_u8(val: u8) -> Self

Source§

impl Word for u128

Source§

const ZERO: Self = 0u128

Source§

const BYTES: usize = 16usize

Source§

const P: Self = 244_418_640_704_343_410_224_161_820_979_800_372_167u128

Source§

const Q: Self = 210_306_068_529_402_873_165_736_369_884_012_333_109u128

Source§

fn from_usize(val: usize) -> Self

Source§

fn from_u8(val: u8) -> Self

Implementors§