Skip to main content

PrimInt

Trait PrimInt 

Source
pub trait PrimInt<const M: usize>: Sized {
    // Required methods
    fn to_bit_array(&self) -> [bool; M];
    fn from_spec_constant<'st>(
        spec_constant: &SpecConstant<'st>,
    ) -> Result<Self, ParseIntError>;
}
Expand description

A primitive integer type that maps onto a bit-vector of width M.

Required Methods§

Source

fn to_bit_array(&self) -> [bool; M]

Convert this value into its big-endian bit-vector representation.

Source

fn from_spec_constant<'st>( spec_constant: &SpecConstant<'st>, ) -> Result<Self, ParseIntError>

Parse this value from a bit-vector literal (#x or #b).

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 PrimInt<8> for u8

Source§

fn to_bit_array(&self) -> [bool; 8]

Source§

fn from_spec_constant<'st>( spec_constant: &SpecConstant<'st>, ) -> Result<Self, ParseIntError>

Source§

impl PrimInt<32> for u32

Source§

fn to_bit_array(&self) -> [bool; 32]

Source§

fn from_spec_constant<'st>( spec_constant: &SpecConstant<'st>, ) -> Result<Self, ParseIntError>

Source§

impl PrimInt<64> for u64

Source§

fn to_bit_array(&self) -> [bool; 64]

Source§

fn from_spec_constant<'st>( spec_constant: &SpecConstant<'st>, ) -> Result<Self, ParseIntError>

Implementors§