Skip to main content

MachineInteger

Trait MachineInteger 

Source
pub trait MachineInteger:
    Sized
    + Copy
    + Clone
    + PartialEq
    + Eq
    + Shr<u32, Output = Self>
    + Shl<u32, Output = Self>
    + BitAnd<Output = Self>
    + BitOr<Output = Self>
    + From<i32> {
    const XLEN: u32;

    // Required methods
    fn bit_slice(&self, i: usize, j: usize) -> Self;
    fn all_set() -> Self;

    // Provided methods
    fn slice_mask(a: usize, b: usize) -> Self { ... }
    fn zero() -> Self { ... }
}

Required Associated Constants§

Required Methods§

Source

fn bit_slice(&self, i: usize, j: usize) -> Self

Source

fn all_set() -> Self

Provided Methods§

Source

fn slice_mask(a: usize, b: usize) -> Self

Source

fn zero() -> Self

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl MachineInteger for i32

Source§

const XLEN: u32 = 32

Source§

fn bit_slice(&self, i: usize, j: usize) -> i32

Source§

fn all_set() -> Self

Source§

impl MachineInteger for i64

Source§

const XLEN: u32 = 64

Source§

fn bit_slice(&self, i: usize, j: usize) -> i64

Source§

fn all_set() -> Self

Source§

impl MachineInteger for i128

Source§

const XLEN: u32 = 128

Source§

fn bit_slice(&self, i: usize, j: usize) -> i128

Source§

fn all_set() -> Self

Implementors§