Trait MachineWord

Source
pub trait MachineWord:
    PrimInt
    + OverflowingAdd
    + OverflowingSub
    + From<u8>
    + BitAndAssign
    + BitOrAssign
    + BitXorAssign
    + FromBytes
    + ToBytes
    + Default {
    type DoubleWord: PrimInt;

    // Required methods
    fn to_double(self) -> Self::DoubleWord;
    fn from_double(word: Self::DoubleWord) -> Self;
}
Expand description

Represents a CPU native word, from 8-bit to 32-bit, with corresponding double-word to hold multiplication/division products.

Required Associated Types§

Required Methods§

Source

fn to_double(self) -> Self::DoubleWord

Source

fn from_double(word: Self::DoubleWord) -> 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 MachineWord for u8

Source§

type DoubleWord = u16

Source§

fn to_double(self) -> Self::DoubleWord

Source§

fn from_double(word: Self::DoubleWord) -> Self

Source§

impl MachineWord for u16

Source§

type DoubleWord = u32

Source§

fn to_double(self) -> Self::DoubleWord

Source§

fn from_double(word: Self::DoubleWord) -> Self

Source§

impl MachineWord for u32

Source§

type DoubleWord = u64

Source§

fn to_double(self) -> Self::DoubleWord

Source§

fn from_double(word: Self::DoubleWord) -> Self

Source§

impl MachineWord for u64

Source§

type DoubleWord = u128

Source§

fn to_double(self) -> Self::DoubleWord

Source§

fn from_double(word: Self::DoubleWord) -> Self

Implementors§