pub struct InMemoryConfirmationStore { /* private fields */ }Expand description
In-memory confirmation store backed by a DashMap.
Each entry carries an AbortHandle for its TTL expiry task, so confirming
or rejecting an action immediately cancels the background timer.
§Concurrency
DashMap guards are never held across .await points. In list_pending,
the entries are collected into a Vec while holding the shard locks, and the
guard is dropped before returning.
Implementations§
Trait Implementations§
Source§impl ConfirmationStore for InMemoryConfirmationStore
impl ConfirmationStore for InMemoryConfirmationStore
Source§fn request_confirmation<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
payload: Value,
ttl: Duration,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn request_confirmation<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
payload: Value,
ttl: Duration,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Store a payload under the given key, replacing any existing entry. Read more
Source§fn confirm<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Value>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn confirm<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Value>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Confirm the action identified by
key. Read moreSource§fn reject<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn reject<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Reject the action identified by
key. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for InMemoryConfirmationStore
impl !UnwindSafe for InMemoryConfirmationStore
impl Freeze for InMemoryConfirmationStore
impl Send for InMemoryConfirmationStore
impl Sync for InMemoryConfirmationStore
impl Unpin for InMemoryConfirmationStore
impl UnsafeUnpin for InMemoryConfirmationStore
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