pub trait HramAccess {
type Value: CellValue;
// Required methods
fn get_cs(&self, cs: CriticalSection<'_>) -> Self::Value;
fn set_cs(&self, cs: CriticalSection<'_>, value: Self::Value);
fn as_ptr(&self) -> *mut Self::Value;
}Expand description
Read and write an HRAM cell under a CriticalSection.
Implemented by every handle the hram! macro generates. An
HramAtomicCell handle implements it too, so code holding a token can
reach either kind through one interface.
Required Associated Types§
Required Methods§
Sourcefn get_cs(&self, cs: CriticalSection<'_>) -> Self::Value
fn get_cs(&self, cs: CriticalSection<'_>) -> Self::Value
Read the cell.
HRAM starts zeroed, so a Value whose all-zero bit pattern is valid may
be read before its first write.
Sourcefn set_cs(&self, cs: CriticalSection<'_>, value: Self::Value)
fn set_cs(&self, cs: CriticalSection<'_>, value: Self::Value)
Write the cell.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".