pub trait StoreMiddleware: Send + Sync {
// Required method
fn write<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
scope: &'life1 Scope,
key: &'life2 str,
value: Value,
options: Option<&'life3 StoreOptions>,
next: &'life4 dyn StoreWriteNext,
) -> Pin<Box<dyn Future<Output = Result<(), StateError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait;
// Provided method
fn read<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
scope: &'life1 Scope,
key: &'life2 str,
next: &'life3 dyn StoreReadNext,
) -> Pin<Box<dyn Future<Output = Result<Option<Value>, StateError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait { ... }
}Expand description
Middleware wrapping StateStore read and write operations.
Use for: encryption-at-rest, audit trails, caching, access control.
Required Methods§
Sourcefn write<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
scope: &'life1 Scope,
key: &'life2 str,
value: Value,
options: Option<&'life3 StoreOptions>,
next: &'life4 dyn StoreWriteNext,
) -> Pin<Box<dyn Future<Output = Result<(), StateError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
fn write<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
scope: &'life1 Scope,
key: &'life2 str,
value: Value,
options: Option<&'life3 StoreOptions>,
next: &'life4 dyn StoreWriteNext,
) -> Pin<Box<dyn Future<Output = Result<(), StateError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Intercept a state write.
Provided Methods§
Sourcefn read<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
scope: &'life1 Scope,
key: &'life2 str,
next: &'life3 dyn StoreReadNext,
) -> Pin<Box<dyn Future<Output = Result<Option<Value>, StateError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn read<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
scope: &'life1 Scope,
key: &'life2 str,
next: &'life3 dyn StoreReadNext,
) -> Pin<Box<dyn Future<Output = Result<Option<Value>, StateError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Intercept a state read. Default: pass through.