pub enum StoreCommand<P, E> {
Persist(E),
PersistFullEvent {
event: E,
snapshot_every: Option<u64>,
},
PersistFull {
event: E,
actor: P,
snapshot_every: Option<u64>,
},
PersistLight(E, P),
Snapshot(P),
Compact,
LastEvent,
LastEventNumber,
LastEventsFrom(u64),
GetEvents {
from: u64,
to: u64,
},
Recover,
Purge,
}Expand description
Commands processed by the internal Store actor.
Variants§
Persist(E)
Persist an event without forcing a snapshot.
PersistFullEvent
Persist an event and report whether the caller should snapshot now.
Fields
event: EEvent to append to the event log.
PersistFull
Persist an event and snapshot the supplied actor state if required.
Fields
event: EEvent to append to the event log.
actor: PCurrent actor state, used when a snapshot is triggered.
PersistLight(E, P)
Persist an event together with a snapshot of the supplied actor state.
Snapshot(P)
Snapshot the supplied actor state immediately.
Compact
Remove event log entries already covered by the latest snapshot.
LastEvent
Return the most recently persisted event.
LastEventNumber
Return the next free event index.
LastEventsFrom(u64)
Return all events from the supplied event index to the end of the log.
GetEvents
Return all events within the inclusive [from, to] range.
Recover
Recover the current actor state from snapshots and events.
Purge
Delete all events, snapshots, and metadata for this actor.
Trait Implementations§
Source§impl<P, E> Clone for StoreCommand<P, E>
impl<P, E> Clone for StoreCommand<P, E>
Source§fn clone(&self) -> StoreCommand<P, E>
fn clone(&self) -> StoreCommand<P, E>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<P, E> Debug for StoreCommand<P, E>
impl<P, E> Debug for StoreCommand<P, E>
Source§impl<P, E> Message for StoreCommand<P, E>where
P: PersistentActor,
<P as Actor>::Event: BorshSerialize + BorshDeserialize,
E: Event + BorshSerialize + BorshDeserialize,
impl<P, E> Message for StoreCommand<P, E>where
P: PersistentActor,
<P as Actor>::Event: BorshSerialize + BorshDeserialize,
E: Event + BorshSerialize + BorshDeserialize,
Source§fn is_critical(&self) -> bool
fn is_critical(&self) -> bool
true if this message must be processed before the actor stops; defaults to false.