Trait BitFieldAccess

Source
pub trait BitFieldAccess: Sealed {
    // Required methods
    fn get_bitfield(&self, mask: Self, shift: u32) -> Self;
    fn set_bitfield(&mut self, mask: Self, shift: u32, value: Self);
}
Expand description

Bitfield access functionality

Note: this trait is sealed against implementation outside this crate. This restriction will be lifted once the API has stabilized.

Required Methods§

Source

fn get_bitfield(&self, mask: Self, shift: u32) -> Self

Returns a copy of self masked by mask and shifted right by shift

Source

fn set_bitfield(&mut self, mask: Self, shift: u32, value: Self)

Shifts value left by shift and replaces bits in self using mask.

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 BitFieldAccess for u8

Source§

fn get_bitfield(&self, mask: Self, shift: u32) -> Self

Source§

fn set_bitfield(&mut self, mask: Self, shift: u32, field: Self)

Source§

impl BitFieldAccess for u16

Source§

fn get_bitfield(&self, mask: Self, shift: u32) -> Self

Source§

fn set_bitfield(&mut self, mask: Self, shift: u32, field: Self)

Source§

impl BitFieldAccess for u32

Source§

fn get_bitfield(&self, mask: Self, shift: u32) -> Self

Source§

fn set_bitfield(&mut self, mask: Self, shift: u32, field: Self)

Source§

impl BitFieldAccess for u64

Source§

fn get_bitfield(&self, mask: Self, shift: u32) -> Self

Source§

fn set_bitfield(&mut self, mask: Self, shift: u32, field: Self)

Source§

impl BitFieldAccess for usize

Source§

fn get_bitfield(&self, mask: Self, shift: u32) -> Self

Source§

fn set_bitfield(&mut self, mask: Self, shift: u32, field: Self)

Implementors§