pub enum StoreEvent<const MCL: usize, const MCC: usize, const MPL: usize, N, S, PD, AT> {
Ingested {
entry: AuthorisedEntry<MCL, MCC, MPL, N, S, PD, AT>,
origin: EntryOrigin,
},
PruneAlert {
cause: AuthorisedEntry<MCL, MCC, MPL, N, S, PD, AT>,
},
Appended(LengthyAuthorisedEntry<MCL, MCC, MPL, N, S, PD, AT>),
EntryForgotten {
entry: AuthorisedEntry<MCL, MCC, MPL, N, S, PD, AT>,
},
AreaForgotten {
area: Area<MCL, MCC, MPL, S>,
protected: Option<Area<MCL, MCC, MPL, S>>,
},
PayloadForgotten(AuthorisedEntry<MCL, MCC, MPL, N, S, PD, AT>),
AreaPayloadsForgotten {
area: Area<MCL, MCC, MPL, S>,
protected: Option<Area<MCL, MCC, MPL, S>>,
},
}Expand description
A notification about changes in a Store. You can obtain a producer of these via the Store::subscribe_area method.
An event subscription takes two parameters: the Area within events should be reported (any store mutations outside that area will not be reported to that subscription), and some optional QueryIgnoreParams for optionally filtering events based on whether they correspond to entries whose payload is the empty string and/or whose payload is not fully available in the local store. A more detailed description of how these ignore options impact events is given in the docs for each enum variant, but the general intuition is for the subscription to act as if it was on a store that did not inlcude ignored entries in the first place.
In the description of the enum variants, we write sub_area for the area of the subscription, and ignores for the subscription QueryIgnoreParams.
Variants§
Ingested
Emitted when an entry is inserted in area.
- If
ignores.ignore_empty_payloads, this is not emitted if the payload of the entry is the empty payload. - If
ignores.ignore_incomplete_payloads, this event is not emitted upon entry insertion, but only once its payload has been fully added to the store. In this case, the ingestion event is guaranteed to be emitted before the corresponding payload append event.
Fields
entry: AuthorisedEntry<MCL, MCC, MPL, N, S, PD, AT>The entry that was inserted.
origin: EntryOriginA tag that determines whether we ourselves created this entry, or whether it arrived from some other data source. In the latter case, the data source is identified by a u64 id. This is not necessarily intented for application-dev-facing APIs, but rather for efficiently implementing replication services (where you want to forward new entries to other peers, but not to those from which you have just received them).
PruneAlert
Emitted whenever an entry is inserted into the store that might cause pruning inside area. It is possible that no entry was actually pruned form the area, if nothing got overwritten.
When the inserted entry falls into area, then the corresponding PruneAlert is always delivered before the corresponding Ingested event.
Fields
cause: AuthorisedEntry<MCL, MCC, MPL, N, S, PD, AT>The entry that caused the pruning.
Appended(LengthyAuthorisedEntry<MCL, MCC, MPL, N, S, PD, AT>)
An existing entry inside area received a portion of its corresponding payload.
If ignores.ignore_incomplete_payloads, this is only emitted when the payload is now fully available. In this case, the corresponding Ingested event is guaranteed to be emitted before this Appended event.
EntryForgotten
Emitted whenever a non-ignored entry in area is forgotten via Store::forget_entry. No corresponding PayloadForgotten event is emitted in this case.
Fields
entry: AuthorisedEntry<MCL, MCC, MPL, N, S, PD, AT>The entry that was forgotten.
AreaForgotten
Emitted whenever a call to Store::forget_area might affect area. No corresponding AreaPayloadForgotten event is emitted in this case.
Fields
PayloadForgotten(AuthorisedEntry<MCL, MCC, MPL, N, S, PD, AT>)
Emitted whenever the payload of a non-ignored entry in area is forgotten via Store::forget_payload. Emitted even if no payload bytes had been available to forget in the first place.
AreaPayloadsForgotten
Emitted whenever a call to Store::forget_area_payloads might affect area.
Trait Implementations§
Source§impl<const MCL: usize, const MCC: usize, const MPL: usize, N: Clone, S: Clone, PD: Clone, AT: Clone> Clone for StoreEvent<MCL, MCC, MPL, N, S, PD, AT>
impl<const MCL: usize, const MCC: usize, const MPL: usize, N: Clone, S: Clone, PD: Clone, AT: Clone> Clone for StoreEvent<MCL, MCC, MPL, N, S, PD, AT>
Source§fn clone(&self) -> StoreEvent<MCL, MCC, MPL, N, S, PD, AT>
fn clone(&self) -> StoreEvent<MCL, MCC, MPL, N, S, PD, AT>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<const MCL: usize, const MCC: usize, const MPL: usize, N: Debug, S: Debug, PD: Debug, AT: Debug> Debug for StoreEvent<MCL, MCC, MPL, N, S, PD, AT>
impl<const MCL: usize, const MCC: usize, const MPL: usize, N: Debug, S: Debug, PD: Debug, AT: Debug> Debug for StoreEvent<MCL, MCC, MPL, N, S, PD, AT>
Source§impl<const MCL: usize, const MCC: usize, const MPL: usize, N: Hash, S: Hash, PD: Hash, AT: Hash> Hash for StoreEvent<MCL, MCC, MPL, N, S, PD, AT>
impl<const MCL: usize, const MCC: usize, const MPL: usize, N: Hash, S: Hash, PD: Hash, AT: Hash> Hash for StoreEvent<MCL, MCC, MPL, N, S, PD, AT>
Source§impl<const MCL: usize, const MCC: usize, const MPL: usize, N: Ord, S: Ord, PD: Ord, AT: Ord> Ord for StoreEvent<MCL, MCC, MPL, N, S, PD, AT>
impl<const MCL: usize, const MCC: usize, const MPL: usize, N: Ord, S: Ord, PD: Ord, AT: Ord> Ord for StoreEvent<MCL, MCC, MPL, N, S, PD, AT>
Source§fn cmp(&self, other: &StoreEvent<MCL, MCC, MPL, N, S, PD, AT>) -> Ordering
fn cmp(&self, other: &StoreEvent<MCL, MCC, MPL, N, S, PD, AT>) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl<const MCL: usize, const MCC: usize, const MPL: usize, N: PartialEq, S: PartialEq, PD: PartialEq, AT: PartialEq> PartialEq for StoreEvent<MCL, MCC, MPL, N, S, PD, AT>
impl<const MCL: usize, const MCC: usize, const MPL: usize, N: PartialEq, S: PartialEq, PD: PartialEq, AT: PartialEq> PartialEq for StoreEvent<MCL, MCC, MPL, N, S, PD, AT>
Source§fn eq(&self, other: &StoreEvent<MCL, MCC, MPL, N, S, PD, AT>) -> bool
fn eq(&self, other: &StoreEvent<MCL, MCC, MPL, N, S, PD, AT>) -> bool
self and other values to be equal, and is used by ==.Source§impl<const MCL: usize, const MCC: usize, const MPL: usize, N: PartialOrd, S: PartialOrd, PD: PartialOrd, AT: PartialOrd> PartialOrd for StoreEvent<MCL, MCC, MPL, N, S, PD, AT>
impl<const MCL: usize, const MCC: usize, const MPL: usize, N: PartialOrd, S: PartialOrd, PD: PartialOrd, AT: PartialOrd> PartialOrd for StoreEvent<MCL, MCC, MPL, N, S, PD, AT>
impl<const MCL: usize, const MCC: usize, const MPL: usize, N: Eq, S: Eq, PD: Eq, AT: Eq> Eq for StoreEvent<MCL, MCC, MPL, N, S, PD, AT>
impl<const MCL: usize, const MCC: usize, const MPL: usize, N, S, PD, AT> StructuralPartialEq for StoreEvent<MCL, MCC, MPL, N, S, PD, AT>
Auto Trait Implementations§
impl<const MCL: usize, const MCC: usize, const MPL: usize, N, S, PD, AT> !Freeze for StoreEvent<MCL, MCC, MPL, N, S, PD, AT>
impl<const MCL: usize, const MCC: usize, const MPL: usize, N, S, PD, AT> RefUnwindSafe for StoreEvent<MCL, MCC, MPL, N, S, PD, AT>
impl<const MCL: usize, const MCC: usize, const MPL: usize, N, S, PD, AT> Send for StoreEvent<MCL, MCC, MPL, N, S, PD, AT>
impl<const MCL: usize, const MCC: usize, const MPL: usize, N, S, PD, AT> Sync for StoreEvent<MCL, MCC, MPL, N, S, PD, AT>
impl<const MCL: usize, const MCC: usize, const MPL: usize, N, S, PD, AT> Unpin for StoreEvent<MCL, MCC, MPL, N, S, PD, AT>
impl<const MCL: usize, const MCC: usize, const MPL: usize, N, S, PD, AT> UnwindSafe for StoreEvent<MCL, MCC, MPL, N, S, PD, AT>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more