diff options
| author | tv <tv@krebsco.de> | 2026-11-29 04:05:41 +0000 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-29 04:08:47 +0000 |
| commit | 2a475153b715c954935ae46d3773ffbf3d007f03 (patch) | |
| tree | 8ebe8a5d6cdaf9869822f95fe2ac7eca0c10cf7f /src/document/replica.rs | |
| parent | 2ae7562083f5f96490f90e9398762cf6a024d51e (diff) | |
document: where a document stands, and a peer, is the document's to compare
document::passing: a Mark, where a document stood, by which what
changed since and the node's own units since are told (changed_since,
own_since: the change publisher, the sync worker); and of where a peer
says it stands, what the document lacks, whether the peer holds what
the document held, a pull of what is lacking, and what it has counting
as sent no more (lacking, peer_holds, pull, heard: the relay,
keepalives). The published stamp gives its summary and its mark.
Diffstat (limited to 'src/document/replica.rs')
| -rw-r--r-- | src/document/replica.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/document/replica.rs b/src/document/replica.rs index a6eaade..092878b 100644 --- a/src/document/replica.rs +++ b/src/document/replica.rs @@ -166,6 +166,18 @@ pub(crate) struct Stamp { pub(crate) heads: Arc<[ChangeHash]>, } +impl Stamp { + /// Where the document stands, as a keepalive says it. + pub(crate) fn summary(&self) -> crate::transport::HeadsSummary { + crate::transport::HeadsSummary::of(self.heads.to_vec()) + } + + /// Where the document stands, to tell later what came since. + pub(crate) fn mark(&self) -> super::passing::Mark { + super::passing::Mark::at(&self.heads) + } +} + impl Replica { pub(crate) fn new(epoch: Epoch, doc: Document) -> Self { let (stamp, _) = watch::channel(Stamp { |
