pub struct Provenance { /* private fields */ }Expand description
Who made a commit, and on whose behalf.
Private fields with one construction point, so a commit signed by a run that does not exist cannot be assembled a field at a time.
Implementations§
Source§impl Provenance
impl Provenance
Sourcepub fn new(
run: RunId,
actor: Address,
city: B3Hash,
chosen: ModelChoice,
) -> Provenance
pub fn new( run: RunId, actor: Address, city: B3Hash, chosen: ModelChoice, ) -> Provenance
The one construction point.
Sourcepub fn succeeding(self, predecessor: RunId) -> Provenance
pub fn succeeding(self, predecessor: RunId) -> Provenance
Names the run this one replaced, so a commit can be asked for its lineage. A sixth trailer, present only when there is one.
Sourcepub fn predecessor(&self) -> Option<RunId>
pub fn predecessor(&self) -> Option<RunId>
The run this one replaced, when it is a successor.
Sourcepub fn city_of(ledger_dir: &Path) -> Result<B3Hash, StorageError>
pub fn city_of(ledger_dir: &Path) -> Result<B3Hash, StorageError>
The city’s identity: the chain hash of its genesis line.
Only the first line of the first segment is read. A city’s whole history can be tens of megabytes, and reading it to learn one hash would make every checkpoint pay for the length of the city’s life.
§Errors
Propagates a ledger directory that cannot be listed or read, and refuses a directory holding no ledger at all — a city with no genesis line has no identity to sign with.
Sourcepub fn run(&self) -> RunId
pub fn run(&self) -> RunId
The run this commit belongs to, which names the reference a wave checkpoint is filed under.
Sourcepub fn attribution(&self) -> CommitAttribution
pub fn attribution(&self) -> CommitAttribution
Which session made this commit, in the shape every record that
names a commit carries it. Both checkpoint_committed and
pr_merged are stamped from here, so the two cannot describe
one commit differently.