pub struct MemoryJournal { /* private fields */ }Expand description
In-memory event journal reference implementation.
All mutations are serialized under one short-lived in-memory lock. This is
intentionally simple: the backend is the correctness oracle for the public
conformance suite, not a production durability layer. Query offsets are a
per-instance append counter and resume strictly after Offset::Sequence(n).
Implementations§
Source§impl MemoryJournal
impl MemoryJournal
Trait Implementations§
Source§impl Clone for MemoryJournal
impl Clone for MemoryJournal
Source§impl Debug for MemoryJournal
impl Debug for MemoryJournal
Source§impl Default for MemoryJournal
impl Default for MemoryJournal
Source§impl EventsByPersistenceIdQuery for MemoryJournal
impl EventsByPersistenceIdQuery for MemoryJournal
Source§fn events_by_persistence_id<'life0, 'life1, 'async_trait>(
&'life0 self,
persistence_id: &'life1 PersistenceId,
from_sequence_nr: SequenceNr,
to_sequence_nr: SequenceNr,
mode: QueryMode,
) -> Pin<Box<dyn Future<Output = PersistenceResult<QueryStream<EventEnvelope>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn events_by_persistence_id<'life0, 'life1, 'async_trait>(
&'life0 self,
persistence_id: &'life1 PersistenceId,
from_sequence_nr: SequenceNr,
to_sequence_nr: SequenceNr,
mode: QueryMode,
) -> Pin<Box<dyn Future<Output = PersistenceResult<QueryStream<EventEnvelope>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Queries the inclusive
[from_sequence_nr, to_sequence_nr] range. Read moreSource§impl EventsByTagQuery for MemoryJournal
impl EventsByTagQuery for MemoryJournal
Source§fn events_by_tag<'life0, 'life1, 'async_trait>(
&'life0 self,
tag: &'life1 Tag,
offset: Offset,
mode: QueryMode,
) -> Pin<Box<dyn Future<Output = PersistenceResult<QueryStream<EventEnvelope>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn events_by_tag<'life0, 'life1, 'async_trait>(
&'life0 self,
tag: &'life1 Tag,
offset: Offset,
mode: QueryMode,
) -> Pin<Box<dyn Future<Output = PersistenceResult<QueryStream<EventEnvelope>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Queries events carrying
tag, resuming gaplessly from offset.Source§impl Journal for MemoryJournal
impl Journal for MemoryJournal
Source§fn append<'life0, 'async_trait>(
&'life0 self,
writes: Vec<AtomicWrite>,
) -> Pin<Box<dyn Future<Output = PersistenceResult<Vec<AppendOutcome>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn append<'life0, 'async_trait>(
&'life0 self,
writes: Vec<AtomicWrite>,
) -> Pin<Box<dyn Future<Output = PersistenceResult<Vec<AppendOutcome>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Appends one independently atomic write per input item. Read more
Source§fn append_one<'life0, 'async_trait>(
&'life0 self,
write: AtomicWrite,
) -> Pin<Box<dyn Future<Output = PersistenceResult<AppendOutcome>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn append_one<'life0, 'async_trait>(
&'life0 self,
write: AtomicWrite,
) -> Pin<Box<dyn Future<Output = PersistenceResult<AppendOutcome>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Appends one atomic write without requiring callers to allocate an input batch. Read more
Source§fn highest_sequence_nr<'life0, 'life1, 'async_trait>(
&'life0 self,
persistence_id: &'life1 PersistenceId,
_from_hint: SequenceNr,
) -> Pin<Box<dyn Future<Output = PersistenceResult<SequenceNr>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn highest_sequence_nr<'life0, 'life1, 'async_trait>(
&'life0 self,
persistence_id: &'life1 PersistenceId,
_from_hint: SequenceNr,
) -> Pin<Box<dyn Future<Output = PersistenceResult<SequenceNr>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Returns the monotonic high watermark for one persistence id. Read more
Source§fn replay<'life0, 'async_trait>(
&'life0 self,
range: ReplayRange,
) -> Pin<Box<dyn Future<Output = PersistenceResult<EventStream>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn replay<'life0, 'async_trait>(
&'life0 self,
range: ReplayRange,
) -> Pin<Box<dyn Future<Output = PersistenceResult<EventStream>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Replays stored, non-deleted events matching an inclusive range. Read more
Source§fn delete_to<'life0, 'life1, 'async_trait>(
&'life0 self,
persistence_id: &'life1 PersistenceId,
inclusive: SequenceNr,
) -> Pin<Box<dyn Future<Output = PersistenceResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_to<'life0, 'life1, 'async_trait>(
&'life0 self,
persistence_id: &'life1 PersistenceId,
inclusive: SequenceNr,
) -> Pin<Box<dyn Future<Output = PersistenceResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Logically deletes events currently stored through
inclusive while
preserving the high watermark. Read moreSource§impl PersistenceIdsQuery for MemoryJournal
impl PersistenceIdsQuery for MemoryJournal
Source§fn persistence_ids<'life0, 'async_trait>(
&'life0 self,
mode: QueryMode,
) -> Pin<Box<dyn Future<Output = PersistenceResult<QueryStream<PersistenceId>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn persistence_ids<'life0, 'async_trait>(
&'life0 self,
mode: QueryMode,
) -> Pin<Box<dyn Future<Output = PersistenceResult<QueryStream<PersistenceId>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Queries each known persistence id once in backend discovery order.
Auto Trait Implementations§
impl Freeze for MemoryJournal
impl RefUnwindSafe for MemoryJournal
impl Send for MemoryJournal
impl Sync for MemoryJournal
impl Unpin for MemoryJournal
impl UnsafeUnpin for MemoryJournal
impl UnwindSafe for MemoryJournal
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<S> IntoEventHandlerResult<S> for S
impl<S> IntoEventHandlerResult<S> for S
Source§fn into_event_handler_result(self) -> Result<S, PersistenceError>
fn into_event_handler_result(self) -> Result<S, PersistenceError>
Converts this handler output into the runtime result.
Source§impl<T> Message for T
impl<T> Message for T
Source§fn from_boxed(m: BoxedMessage) -> Result<Self, BoxedDowncastErr>
fn from_boxed(m: BoxedMessage) -> Result<Self, BoxedDowncastErr>
Convert a BoxedMessage to this concrete type
Source§fn box_message(self, pid: &ActorId) -> Result<BoxedMessage, BoxedDowncastErr>
fn box_message(self, pid: &ActorId) -> Result<BoxedMessage, BoxedDowncastErr>
Convert this message to a BoxedMessage