1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
use async_trait;
use crateRunFootprint;
use crateStorageResult;
/// The pipeline-independent half of an entity storage backend.
///
/// A backend implements this trait together with the `{PipelineName}Storage` trait that
/// [`define_operon!`](crate::define_operon) generates.
/// This trait specifically owns the backend's lifecycle and its run footprint,
/// while the generated half owns the per-entity accessors.
/// Every method reports failure as [`Self::Error`], which reaches the caller as
/// [`StorageError::Backend`](crate::error::StorageError::Backend).
///
/// # Run footprints
///
/// A [`RunFootprint`] records which run last wrote to this backend and the
/// [`RunState`](crate::RunState) it ended in.
/// Operon compares the footprint stored here against the one held by the metadata storage to decide
/// whether a previous run can be resumed, and treats a disagreement between the two as an aborted
/// run.
/// [`Uuid`](crate::Uuid), [`DateTime`](crate::DateTime), and [`Utc`](crate::Utc) are re-exported
/// from the `uuid` and `chrono` crates for construction of the footprint.
///
/// Both footprint methods default to no-ops, and a backend that does not implement them will have
/// recovery disabled.
/// Implement both to resume a gracefully stopped run instead of recomputing it.