pub struct JournalSagaStateStore<J: Journal> { /* private fields */ }Expand description
Journal-backed saga state store.
Each (saga_name, correlation_id) pair is treated as a single
persistence id (saga::<saga_name>::<correlation_id>). Saves
append a new event; loads replay the stream and return the most
recent state payload. keys() is best-effort — it consults
Journal::all_persistence_ids.
Implementations§
Trait Implementations§
Source§impl<J: Journal> SagaStateStore for JournalSagaStateStore<J>
impl<J: Journal> SagaStateStore for JournalSagaStateStore<J>
Source§fn load<'life0, 'life1, 'async_trait>(
&'life0 self,
correlation_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Option<Vec<u8>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load<'life0, 'life1, 'async_trait>(
&'life0 self,
correlation_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Option<Vec<u8>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Load the persisted state for
correlation_id. None means no
state exists yet (treat as fresh / Default).Source§fn save<'life0, 'life1, 'async_trait>(
&'life0 self,
correlation_id: &'life1 str,
payload: Vec<u8>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn save<'life0, 'life1, 'async_trait>(
&'life0 self,
correlation_id: &'life1 str,
payload: Vec<u8>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Persist
payload as the latest state for correlation_id.Auto Trait Implementations§
impl<J> Freeze for JournalSagaStateStore<J>
impl<J> RefUnwindSafe for JournalSagaStateStore<J>where
J: RefUnwindSafe,
impl<J> Send for JournalSagaStateStore<J>
impl<J> Sync for JournalSagaStateStore<J>
impl<J> Unpin for JournalSagaStateStore<J>where
J: Unpin,
impl<J> UnsafeUnpin for JournalSagaStateStore<J>
impl<J> UnwindSafe for JournalSagaStateStore<J>where
J: RefUnwindSafe + UnwindSafe,
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