pub struct WriteOneToClear<T>(/* private fields */);Expand description
A handler implementation that fakes write-1-to-clear registers of width T.
WriteOneToClear replaces every store of v with a fetch_and(!v), which
has the final effect of faking registers that clear the set bits on write.
The handler panics on both loads and stores if the operand width does not
match T.
Implementations§
Source§impl<T> WriteOneToClear<T>
impl<T> WriteOneToClear<T>
Trait Implementations§
Source§impl<T> Default for WriteOneToClear<T>
impl<T> Default for WriteOneToClear<T>
Source§impl<T> GenericVmoMemoryHandler for WriteOneToClear<T>
impl<T> GenericVmoMemoryHandler for WriteOneToClear<T>
Source§fn load<X: MmioOperand>(&self, op: VmoOpHelper<'_, X>) -> X
fn load<X: MmioOperand>(&self, op: VmoOpHelper<'_, X>) -> X
Handles an MMIO load operation for type
T.Source§fn store<X: MmioOperand>(&self, op: VmoOpHelper<'_, X>, value: X)
fn store<X: MmioOperand>(&self, op: VmoOpHelper<'_, X>, value: X)
Handles an MMIO store operation for type
T.Auto Trait Implementations§
impl<T> Freeze for WriteOneToClear<T>where
PhantomData<T>: Freeze,
impl<T> RefUnwindSafe for WriteOneToClear<T>where
PhantomData<T>: RefUnwindSafe,
impl<T> Send for WriteOneToClear<T>where
PhantomData<T>: Send,
impl<T> Sync for WriteOneToClear<T>where
PhantomData<T>: Sync,
impl<T> Unpin for WriteOneToClear<T>where
PhantomData<T>: Unpin,
impl<T> UnsafeUnpin for WriteOneToClear<T>where
PhantomData<T>: UnsafeUnpin,
impl<T> UnwindSafe for WriteOneToClear<T>where
PhantomData<T>: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more