HashCache is a wrapper around a Stashable object that caches
the hash value of that object between repeated non-mutable
accesses. Mutably accessing the stored object invalidates
the cached hash value, which is only recomputed as needed.
HashCacheProperty is the cached result of a function call that is only
evaluated lazily whenever the inputs have changed, according to their
ObjectHash.
A container storing the serialized contents of stashed objects
in a deduplicated manner, with which new objects can recreated
from past snapshots and with which existing objects can be rolled
back to a different state.
A handle to a shared stashed object living in a Stash.
Holding this handle ensures that the stash object is
not cleaned up, and dropping this handle may result in
the stashed object being removed from the stash.
A stasher is used to visit the contents of an object as part of its
Stashable::stash implementation, interchangeably to both hash and
to serialize those contents.
Errors that can happen during one of the round trip tests,
which indicate a bug in an object’s stashing and unstashing
implementations. See each variant’s documentation for
explanations about how these bugs can be fixed.
Stash an object and immediately unstash it out-of-place, effectively
performing a deep clone of the object. This can be used where
implementing Clone is difficult (e.g. involving trait objects and
factories) and/or would duplicate logic already needed for stashing
and unstashing.
Perform an end-to-end test of a Stashable object which
implements Unstashable. The given create function
must produce a new instance of the desired object type and
the given modify function must mutate that same object
such that it is logically distinct afterwards and hashes
to a different value. See RoundTripError for possible
failures and their explanations.
Perform an end-to-end test of a Stashable object which
implements UnstashableInplace. The given create function
must produce a new instance of the desired object type and
the given modify function must mutate that same object
such that it is logically distinct afterwards and hashes
to a different value. See RoundTripError for possible
failures and their explanations.