pub struct FailingJournal { /* private fields */ }Expand description
In-memory journal test double with one-shot append failure controls.
Implementations§
Source§impl FailingJournal
impl FailingJournal
Sourcepub fn fail_next_append(&self)
pub fn fail_next_append(&self)
Makes the next append return a storage failure, then resumes pass-through behavior.
Sourcepub fn reject_next_append(&self)
pub fn reject_next_append(&self)
Makes the next append deterministically reject every atomic write.
Trait Implementations§
Source§impl Debug for FailingJournal
impl Debug for FailingJournal
Source§impl Default for FailingJournal
impl Default for FailingJournal
Source§impl Journal for FailingJournal
impl Journal for FailingJournal
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 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§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
Auto Trait Implementations§
impl !Freeze for FailingJournal
impl RefUnwindSafe for FailingJournal
impl Send for FailingJournal
impl Sync for FailingJournal
impl Unpin for FailingJournal
impl UnsafeUnpin for FailingJournal
impl UnwindSafe for FailingJournal
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> 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