diff --git a/data-model/src/store.rs b/data-model/src/store.rs index e7b9790..9231355 100644 --- a/data-model/src/store.rs +++ b/data-model/src/store.rs @@ -149,7 +149,11 @@ where AT: AuthorisationToken, { /// A new entry was ingested. - Ingested(u64, AuthorisedEntry), + Ingested( + u64, + AuthorisedEntry, + EntryOrigin, + ), /// An existing entry received a portion of its corresponding payload. Appended(u64, LengthyAuthorisedEntry), /// An entry was forgotten. @@ -188,6 +192,14 @@ pub enum ForgetPayloadError { ReferredToByOtherEntries, } +/// The origin of an entry ingestion event. +pub enum EntryOrigin { + /// The entry was probably created on this machine. + Local, + /// The entry was sourced from another device, e.g. a networked sync session. + Remote(u64), +} + /// A [`Store`] is a set of [`AuthorisedEntry`] belonging to a single namespace, and a (possibly partial) corresponding set of payloads. pub trait Store where