mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-22 18:41:27 +01:00
A memoized view's content is a fn and its props are its only input, so the framework sees every input it reads. While its key (the props type, the fn's address and the props' inputs) equals the key after its last run, it adds that run again and returns what the run returned. Lazy and MemoView share one runner and one settled test; a memo view ignores the two rules that infer a change of app data (input arrived, a repaint was asked), replays a run of an earlier pass of the same frame when nothing it read was edited after the run started and the run asked for no discard pass, and keeps its entry through absence up to twice the shown views per viewport. MemoProps gains identity() (the props type with its lifetimes erased, through the typeid crate), &mut Tracked<T> by revision and Bind by value and place. A binding's check takes its inputs as props: check(fn) and check_with(inputs, fn), one mechanism; a composite hands its check on through BindMut::check_of. The preset name check (NameCheck) takes inputs the same way, with PresetNames as a library's names. Glyph is Any + MemoProps, and an icon keys a glyph by its type, then by its key; the caption glyph owns an Arc<CaptionIcons>. Facts::register is journaled, layout memory notes discard asks into the open record, and the settle counters become MemoRun and last_pass_memo_runs. The idle-frame trial moves onto memo views, beside count trials of the mechanism.