Expand description
§Recallable
A crate for handling partial updates to data structures.
This crate provides the Recallable, Recall, and TryRecall traits, along with
derive macros for Recallable and Recall, and an attribute macro recallable_model
re-exported from recallable_macro for easy derivation.
§Motivation
Many systems receive incremental updates where only a subset of fields change or can be considered part of the state. This crate formalizes this pattern by defining a memento type for a structure and providing a consistent way to apply such mementos safely.
Traits§
- Recall
- A type that can change state by absorbing one companion memento value.
- Recallable
- A type that declares a companion memento type.
- TryRecall
- A fallible variant of
Recall.
Attribute Macros§
- recallable_
model - Attribute macro that augments a struct with
Recallable/Recallderives.
Derive Macros§
- Recall
- Derive macro that generates the
Recalltrait implementation. - Recallable
- Derive macro that generates the companion memento type and
Recallableimpl.