Enum StoreEvent

Source
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: EntryOrigin

A 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

§area: Area<MCL, MCC, MPL, S>

The area that was forgotten.

§protected: Option<Area<MCL, MCC, MPL, S>>

A subarea that was retained (if any).

§

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.

Fields

§area: Area<MCL, MCC, MPL, S>

The area whose payloads were forgotten.

§protected: Option<Area<MCL, MCC, MPL, S>>

A subarea whose payloads were retained (if any).

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>

Source§

fn clone(&self) -> StoreEvent<MCL, MCC, MPL, N, S, PD, AT>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

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§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
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>

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
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>

Source§

fn cmp(&self, other: &StoreEvent<MCL, MCC, MPL, N, S, PD, AT>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
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>

Source§

fn eq(&self, other: &StoreEvent<MCL, MCC, MPL, N, S, PD, AT>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
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>

Source§

fn partial_cmp( &self, other: &StoreEvent<MCL, MCC, MPL, N, S, PD, AT>, ) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

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>

Source§

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>
where AT: Send, N: Send, S: Send, PD: Send,

§

impl<const MCL: usize, const MCC: usize, const MPL: usize, N, S, PD, AT> Sync for StoreEvent<MCL, MCC, MPL, N, S, PD, AT>
where AT: Sync, N: Sync, S: Sync, PD: Sync,

§

impl<const MCL: usize, const MCC: usize, const MPL: usize, N, S, PD, AT> Unpin for StoreEvent<MCL, MCC, MPL, N, S, PD, AT>
where AT: Unpin, N: Unpin, S: Unpin, PD: Unpin,

§

impl<const MCL: usize, const MCC: usize, const MPL: usize, N, S, PD, AT> UnwindSafe for StoreEvent<MCL, MCC, MPL, N, S, PD, AT>
where AT: UnwindSafe, N: UnwindSafe, S: UnwindSafe, PD: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.