EditRegister

Trait EditRegister 

Source
pub trait EditRegister<R, A>
where for<'a> R: EditableRegister<Address = A> + 'a,
{ type Error; // Required method async fn edit<F>(&mut self, f: F) -> Result<(), Self::Error> where for<'w> F: FnOnce(&'w mut R); }
Expand description

Trait to safely read-edit-write a register. Usefull when a register has reserved values for internal uses. Avoids writing garbage to the reserved bits.

Required Associated Types§

Source

type Error

The error type returned by editing a register

Required Methods§

Source

async fn edit<F>(&mut self, f: F) -> Result<(), Self::Error>
where for<'w> F: FnOnce(&'w mut R),

Edit a register. The closure takes a reference to the register, the same register must be edited, then returned.

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.

Implementors§

Source§

impl<I, R, A> EditRegister<R, A> for I
where for<'a> R: EditableRegister<Address = A> + 'a, I: RegisterInterface<R, A>, for<'a> A: 'a,