pub trait EditRegister<R, A>where
    R: EditableRegister<Address = A>,
{ type Error; fn edit<F>(&mut self, f: F) -> Result<(), Self::Error>
    where
        for<'w> F: FnOnce(&'w mut R) -> &'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

Error type returned by editing the register

Required Methods

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

Implementors