Struct ReadRegWrapper

Source
pub struct ReadRegWrapper<'a, T, N, R>(/* private fields */)
where
    T: UIntLike,
    N: RegisterLongName,
    R: BaseReadableRegister<T>;
Expand description

Workaround-wrapper for readable LiteX registers

This workaround-wrapper is required to make an associated type of LiteXSoCRegisterConfiguration generic over the RegisterLongName until generic associated types stabilize in Rust. Please see the LiteXSoCRegisterConfiguration documentation for more information.

Implementations§

Source§

impl<'a, T, N, R> ReadRegWrapper<'a, T, N, R>

Source

pub fn wrap(reg: &'a R) -> ReadRegWrapper<'a, T, N, R>

Trait Implementations§

Source§

impl<T, N, R> BaseReadableRegister<T> for ReadRegWrapper<'_, T, N, R>

Source§

const REG_WIDTH: usize = R::REG_WIDTH

Source§

type Reg = N

Source§

fn base_get(&self) -> T

Get the raw register value

Auto Trait Implementations§

§

impl<'a, T, N, R> Freeze for ReadRegWrapper<'a, T, N, R>

§

impl<'a, T, N, R> RefUnwindSafe for ReadRegWrapper<'a, T, N, R>

§

impl<'a, T, N, R> Send for ReadRegWrapper<'a, T, N, R>
where R: Sync, T: Send, N: Send,

§

impl<'a, T, N, R> Sync for ReadRegWrapper<'a, T, N, R>
where R: Sync, T: Sync, N: Sync,

§

impl<'a, T, N, R> Unpin for ReadRegWrapper<'a, T, N, R>
where T: Unpin, N: Unpin,

§

impl<'a, T, N, R> UnwindSafe for ReadRegWrapper<'a, T, N, R>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<R, T> Read<T> for R

Source§

const REG_WIDTH: usize = R::REG_WIDTH

Source§

type Reg = <R as BaseReadableRegister<T>>::Reg

Source§

fn get(&self) -> T

Get the raw register value
Source§

fn read(&self, field: Field<T, <R as Read<T>>::Reg>) -> T

Read the value of the given field
Source§

fn read_as_enum<E>(&self, field: Field<T, <R as Read<T>>::Reg>) -> Option<E>
where E: TryFromValue<T, EnumType = E>,

Read value of the given field as an enum member
Source§

fn extract(&self) -> LocalRegisterCopy<T, <R as Read<T>>::Reg>

Make a local copy of the register
Source§

fn is_set(&self, field: Field<T, <R as Read<T>>::Reg>) -> bool

Check if one or more bits in a field are set
Source§

fn any_matching_bits_set( &self, field: FieldValue<T, <R as Read<T>>::Reg>, ) -> bool

Check if any specified parts of a field match
Source§

fn matches_all(&self, field: FieldValue<T, <R as Read<T>>::Reg>) -> bool

Check if all specified parts of a field match
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.