diff options
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 { |
