Skip to main content

Module cell

Module cell 

Source
Expand description

Single-threaded interior-mutability primitives.

LvCell<T> and LvRefCell<T> are thin newtypes around core::cell::Cell / RefCell that are Sync. The name carries a contract, not a runtime enforcement: the cell may only be mutated from one thread at a time. In LVGL apps the global LVGL lock enforces this; in other contexts, the caller must ensure single-threaded access (e.g. the cell is only touched inside a benchmark’s setup/run/teardown on one thread at a time).

Structs§

LvCell
Cell<T> for state mutated only from a single logical thread at a time. Marked Sync — the caller is responsible for upholding the single-access invariant (e.g. via a lock like LVGL’s, or by structural guarantees in an embedded setup/run/teardown flow).
LvRefCell
RefCell<T> variant of LvCell for non-Copy state.