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.
The crate itself is #![no_std]. Enabling the serde feature does not require std; it only
turns on macro-generated serde support, and it remains usable in no_std environments when
your serde stack is configured without std.
§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.
The crate intentionally does not prescribe one canonical memento shape for container-like
field types. A type may choose whole-value replacement, selective inner updates, or some other
domain-specific behavior, and the derive macros defer to that type’s own
Recallable::Memento and Recall::recall implementations.
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 prepares a struct for the Memento pattern.
Derive Macros§
- Recall
- Derive macro that generates the
Recalltrait implementation. - Recallable
- Derive macro that generates a companion memento struct and the
Recallabletrait impl.