pub struct SnapshotChain { /* private fields */ }Expand description
The home’s attestation chain, as far as a reader has read its log:
each RecordRefSnapshot’s id and the id its prev_snapshot names.
Built from /api/log pages, which a reader holds, rather than from
anything a seed says about itself.
Implementations§
Source§impl SnapshotChain
impl SnapshotChain
Sourcepub fn read_page(&mut self, entries: &[Value]) -> usize
pub fn read_page(&mut self, entries: &[Value]) -> usize
Adds every attestation in a page of /api/log entries, and says
how many it found.
Sourcepub fn insert(&mut self, id: String, prev: Option<String>)
pub fn insert(&mut self, id: String, prev: Option<String>)
Records one link: attestation id follows prev.
Sourcepub fn steps_back(&self, from: &str, to: &str) -> Option<u64>
pub fn steps_back(&self, from: &str, to: &str) -> Option<u64>
How many prev_snapshot links lead from from back to to, or
None when to is not an ancestor of from in what was read.
Sourcepub fn relate(&self, a: &str, b: &str) -> Relation
pub fn relate(&self, a: &str, b: &str) -> Relation
The fork rule: a and b agree when one is the other’s ancestor,
or they are equal, and are a fork when neither is.
A statement over S endorses S and everything reachable from it
by prev_snapshot, so how many attestations landed between two
readers’ looks does not matter, and a seed need not race the home.
For the walk to be complete, the chain must hold every attestation
from the lower of the two positions onward.
Trait Implementations§
Source§impl Clone for SnapshotChain
impl Clone for SnapshotChain
Source§fn clone(&self) -> SnapshotChain
fn clone(&self) -> SnapshotChain
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more