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
use serde::{Deserialize, Serialize};
use super::{SourceRecordRef, StepId, StepOutput};
/// One completed step of a predecessor, carried into a successor step.
///
/// The output travels because a successor that could not read what was
/// decided would be starting over; the source travels because a step
/// the successor never ran must never read as though it had. Both
/// halves are the point: evidence without provenance is a copy, and
/// provenance without the output is a footnote.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct CarriedEvidence {
successor_step_id: StepId,
source: SourceRecordRef,
output: StepOutput,
}
impl CarriedEvidence {
#[must_use]
pub const fn new(
successor_step_id: StepId,
source: SourceRecordRef,
output: StepOutput,
) -> Self {
Self {
successor_step_id,
source,
output,
}
}
#[must_use]
pub const fn successor_step_id(&self) -> &StepId {
&self.successor_step_id
}
#[must_use]
pub const fn source(&self) -> &SourceRecordRef {
&self.source
}
#[must_use]
pub const fn output(&self) -> &StepOutput {
&self.output
}
}