Struct WriteRegWrapper

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

Workaround-wrapper for writable 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> WriteRegWrapper<'a, T, N, R>

Source

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

Trait Implementations§

Source§

impl<T, N, R> BaseWriteableRegister<T> for WriteRegWrapper<'_, T, N, R>

Source§

const REG_WIDTH: usize = R::REG_WIDTH

Source§

type Reg = N

Source§

fn base_set(&self, value: T)

Set the raw register value

Auto Trait Implementations§

§

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

§

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

§

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

§

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

§

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

§

impl<'a, T, N, R> UnwindSafe for WriteRegWrapper<'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<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.
Source§

impl<R, T> Write<T> for R

Source§

const REG_WIDTH: usize = R::REG_WIDTH

Source§

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

Source§

fn set(&self, value: T)

Set the raw register value
Source§

fn write(&self, field: FieldValue<T, <R as Write<T>>::Reg>)

Write the value of one or more fields, overwriting the other fields with zero