aboutsummaryrefslogtreecommitdiffstats
path: root/src/federation/store/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/federation/store/mod.rs')
-rw-r--r--src/federation/store/mod.rs10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/federation/store/mod.rs b/src/federation/store/mod.rs
index 4027fb9..c80f5b8 100644
--- a/src/federation/store/mod.rs
+++ b/src/federation/store/mod.rs
@@ -82,13 +82,21 @@ pub(crate) trait Fold {
/// What the event builds on; `None` where its bytes are none of this fold's events.
fn dependencies(event: &[u8]) -> Option<Vec<Id>>;
- /// Whether the event is taken where its history reads as `at`.
+ /// Whether the event is taken where its history reads as `at`, as far as the fold
+ /// reads it (`stops`).
fn judge(at: &Self::State, id: &Id, event: &[u8]) -> Result<(), Refused>;
/// Adds the event, whose dependencies are added already. Events neither of which
/// builds on the other may come in either order: the state is the same.
fn add(state: &mut Self::State, id: &Id, event: &[u8]);
+ /// Why a node whose store reads as `now` can't judge an event its history, read as
+ /// `at`, doesn't refuse, where it can't: one only a fold knowing more reads, that the
+ /// node would take. The store stops at it (`docs/store.md`, A node's own).
+ fn stops(_at: &Self::State, _now: &Self::State, _id: &Id, _event: &[u8]) -> Option<String> {
+ None
+ }
+
/// Whether a node whose store reads as `now` takes an event its history takes.
fn keeps(_now: &Self::State, _id: &Id, _event: &[u8]) -> bool {
true