Skip to main content

UIntLike

Trait UIntLike 

pub trait UIntLike: UIntLike {
    // Required methods
    fn one() -> Self;
    fn trailing_zeros(self) -> u32;
    fn into_usize(self) -> usize;

    // Provided method
    fn max() -> Self { ... }
}
Expand description

Extension of the tock_registers UIntLike trait.

This extends the UIntLike trait of tock_registers to also provide the 1 and maximum (all bits set) values of the respective integer type

This allows for peripherals to be written generic over the underlying CSR width (as in the case of event managers, LEDs, etc.), manipulating bitmaps

Required Methods§

fn one() -> Self

fn trailing_zeros(self) -> u32

fn into_usize(self) -> usize

Provided Methods§

fn max() -> Self

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

§

impl UIntLike for u8

§

fn one() -> u8

§

fn trailing_zeros(self) -> u32

§

fn into_usize(self) -> usize

§

impl UIntLike for u16

§

fn one() -> u16

§

fn trailing_zeros(self) -> u32

§

fn into_usize(self) -> usize

§

impl UIntLike for u32

§

fn one() -> u32

§

fn trailing_zeros(self) -> u32

§

fn into_usize(self) -> usize

§

impl UIntLike for u64

§

fn one() -> u64

§

fn trailing_zeros(self) -> u32

§

fn into_usize(self) -> usize

§

impl UIntLike for u128

§

fn one() -> u128

§

fn trailing_zeros(self) -> u32

§

fn into_usize(self) -> usize

Implementors§