Skip to content

Commit

Permalink
Add EntryOrigin to ingestion
Browse files Browse the repository at this point in the history
  • Loading branch information
sgwilym committed Aug 29, 2024
1 parent b8a87ad commit b8de760
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion data-model/src/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,11 @@ where
AT: AuthorisationToken<MCL, MCC, MPL, N, S, PD>,
{
/// A new entry was ingested.
Ingested(u64, AuthorisedEntry<MCL, MCC, MPL, N, S, PD, AT>),
Ingested(
u64,
AuthorisedEntry<MCL, MCC, MPL, N, S, PD, AT>,
EntryOrigin,
),
/// An existing entry received a portion of its corresponding payload.
Appended(u64, LengthyAuthorisedEntry<MCL, MCC, MPL, N, S, PD, AT>),
/// An entry was forgotten.
Expand Down Expand Up @@ -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<const MCL: usize, const MCC: usize, const MPL: usize, N, S, PD, AT>
where
Expand Down

0 comments on commit b8de760

Please sign in to comment.