Skip to main content

AuthStorage

Trait AuthStorage 

Source
pub trait AuthStorage: Send + Sync {
Show 24 methods // Required methods fn store_token<'life0, 'life1, 'async_trait>( &'life0 self, token: &'life1 AuthToken, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn get_token<'life0, 'life1, 'async_trait>( &'life0 self, token_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<AuthToken>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn get_token_by_access_token<'life0, 'life1, 'async_trait>( &'life0 self, access_token: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<AuthToken>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn update_token<'life0, 'life1, 'async_trait>( &'life0 self, token: &'life1 AuthToken, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn delete_token<'life0, 'life1, 'async_trait>( &'life0 self, token_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn list_user_tokens<'life0, 'life1, 'async_trait>( &'life0 self, user_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<AuthToken>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn store_session<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, session_id: &'life1 str, data: &'life2 SessionData, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn get_session<'life0, 'life1, 'async_trait>( &'life0 self, session_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<SessionData>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn delete_session<'life0, 'life1, 'async_trait>( &'life0 self, session_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn list_user_sessions<'life0, 'life1, 'async_trait>( &'life0 self, user_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<SessionData>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn count_active_sessions<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn store_kv<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, key: &'life1 str, value: &'life2 [u8], ttl: Option<Duration>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn get_kv<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn delete_kv<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn cleanup_expired<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; // Provided methods fn store_tokens_bulk<'life0, 'life1, 'async_trait>( &'life0 self, tokens: &'life1 [AuthToken], ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn delete_tokens_bulk<'life0, 'life1, 'async_trait>( &'life0 self, token_ids: &'life1 [String], ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn store_sessions_bulk<'life0, 'life1, 'async_trait>( &'life0 self, sessions: &'life1 [(String, SessionData)], ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn delete_sessions_bulk<'life0, 'life1, 'async_trait>( &'life0 self, session_ids: &'life1 [String], ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn store_kv_if_absent<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _key: &'life1 str, _value: &'life2 [u8], _ttl: Option<Duration>, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn get_kv_ttl<'life0, 'life1, 'async_trait>( &'life0 self, _key: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<Duration>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn tracks_kv_ttl(&self) -> bool { ... } fn encrypts_kv_at_rest(&self) -> bool { ... } fn list_kv_keys<'life0, 'life1, 'async_trait>( &'life0 self, _prefix: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... }
}
Expand description

Trait for authentication data storage backends.

All persistence in AuthFramework goes through this trait — tokens, sessions, and arbitrary key-value data. Implement it to plug in a custom database while keeping the rest of the framework unchanged.

§Provided Implementations

BackendTypeFeature flag
In-memory (DashMap)MemoryStorage(always available)
PostgreSQLPostgresStoragepostgres-storage
Redis[RedisStorage]redis-storage
SQLiteSqliteStoragesqlite-storage
Encrypted wrapperEncryptedStorage(always available)

§Implementing This Trait

Custom storage backends must:

  1. Be thread-safe — the trait requires Send + Sync.
  2. Handle concurrent access — multiple tasks will read/write simultaneously. Use connection pooling or interior mutability.
  3. Honour TTL — store_kv accepts an optional TTL. Expired entries must not be returned by get_kv.
  4. Override list_kv_keys — the default returns an empty Vec. Analytics, compliance, and RBAC queries depend on real data.
  5. Implement cleanup_expired — periodically called to prune stale tokens and sessions.

§Example (skeleton)

use auth_framework::storage::{AuthStorage, SessionData};
use auth_framework::tokens::AuthToken;
use auth_framework::errors::Result;
use async_trait::async_trait;
use std::time::Duration;

struct MyStorage { /* ... */ }

#[async_trait]
impl AuthStorage for MyStorage {
    async fn store_token(&self, token: &AuthToken) -> Result<()> { todo!() }
    async fn get_token(&self, token_id: &str) -> Result<Option<AuthToken>> { todo!() }
    async fn get_token_by_access_token(&self, _: &str) -> Result<Option<AuthToken>> { todo!() }
    async fn update_token(&self, token: &AuthToken) -> Result<()> { todo!() }
    async fn delete_token(&self, token_id: &str) -> Result<()> { todo!() }
    async fn list_user_tokens(&self, user_id: &str) -> Result<Vec<AuthToken>> { todo!() }
    async fn store_session(&self, id: &str, data: &SessionData) -> Result<()> { todo!() }
    async fn get_session(&self, id: &str) -> Result<Option<SessionData>> { todo!() }
    async fn delete_session(&self, id: &str) -> Result<()> { todo!() }
    async fn list_user_sessions(&self, user_id: &str) -> Result<Vec<SessionData>> { todo!() }
    async fn count_active_sessions(&self) -> Result<u64> { todo!() }
    async fn store_kv(&self, key: &str, value: &[u8], ttl: Option<Duration>) -> Result<()> { todo!() }
    async fn get_kv(&self, key: &str) -> Result<Option<Vec<u8>>> { todo!() }
    async fn delete_kv(&self, key: &str) -> Result<()> { todo!() }
    async fn list_kv_keys(&self, prefix: &str) -> Result<Vec<String>> { todo!() }
    async fn cleanup_expired(&self) -> Result<()> { todo!() }
}

Required Methods§

Source

fn store_token<'life0, 'life1, 'async_trait>( &'life0 self, token: &'life1 AuthToken, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Store a token.

Source

fn get_token<'life0, 'life1, 'async_trait>( &'life0 self, token_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<AuthToken>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Retrieve a token by ID.

Source

fn get_token_by_access_token<'life0, 'life1, 'async_trait>( &'life0 self, access_token: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<AuthToken>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Retrieve a token by access token string.

Source

fn update_token<'life0, 'life1, 'async_trait>( &'life0 self, token: &'life1 AuthToken, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Update a token.

Source

fn delete_token<'life0, 'life1, 'async_trait>( &'life0 self, token_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Delete a token.

Source

fn list_user_tokens<'life0, 'life1, 'async_trait>( &'life0 self, user_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<AuthToken>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

List all tokens for a user.

Source

fn store_session<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, session_id: &'life1 str, data: &'life2 SessionData, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Store session data.

Source

fn get_session<'life0, 'life1, 'async_trait>( &'life0 self, session_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<SessionData>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Retrieve session data.

Source

fn delete_session<'life0, 'life1, 'async_trait>( &'life0 self, session_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Delete session data.

Source

fn list_user_sessions<'life0, 'life1, 'async_trait>( &'life0 self, user_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<SessionData>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

List all sessions for a user.

Source

fn count_active_sessions<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Count currently active sessions (non-expired)

Source

fn store_kv<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, key: &'life1 str, value: &'life2 [u8], ttl: Option<Duration>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Store arbitrary key-value data with expiration.

Source

fn get_kv<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Retrieve arbitrary key-value data.

Source

fn delete_kv<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Delete arbitrary key-value data.

Source

fn cleanup_expired<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Clean up expired data.

Provided Methods§

Source

fn store_tokens_bulk<'life0, 'life1, 'async_trait>( &'life0 self, tokens: &'life1 [AuthToken], ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Bulk store tokens.

Source

fn delete_tokens_bulk<'life0, 'life1, 'async_trait>( &'life0 self, token_ids: &'life1 [String], ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Bulk delete tokens by ID.

Source

fn store_sessions_bulk<'life0, 'life1, 'async_trait>( &'life0 self, sessions: &'life1 [(String, SessionData)], ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Bulk store sessions.

Source

fn delete_sessions_bulk<'life0, 'life1, 'async_trait>( &'life0 self, session_ids: &'life1 [String], ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Bulk delete sessions by ID.

Source

fn store_kv_if_absent<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _key: &'life1 str, _value: &'life2 [u8], _ttl: Option<Duration>, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Store value under key only if no live entry exists. Returns whether it was stored.

This is a compare-and-set: of several simultaneous callers exactly one gets true. Single-use markers (refresh-token redemption, TOTP steps, WebAuthn sessions, PKCE codes) depend on that, so a backend must implement it atomically; there is no default that could be correct for every store (a get_kv followed by store_kv is not atomic). The default therefore fails with an error, and the paths that need a claim fail with it rather than run without the guarantee. The memory, SQLite (both crates), PostgreSQL, Redis, unified and encrypted-wrapper backends and the test-only MockStorage implement it.

Source

fn get_kv_ttl<'life0, 'life1, 'async_trait>( &'life0 self, _key: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<Duration>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Remaining time-to-live of a key-value entry.

Returns Ok(None) when the key is absent, has no expiry, or the backend does not track TTLs (the default). Callers that must carry an entry’s lifetime across a copy (backup/restore, migration) use this together with get_kv; a backend that honours the TTL passed to store_kv should override it so those entries do not silently become non-expiring. An entry that get_kv would still return but that expires within the backend’s time resolution reports Some(Duration::ZERO), never None.

Source

fn tracks_kv_ttl(&self) -> bool

Whether get_kv_ttl reports the TTLs given to store_kv. false (the default) means a TTL is invisible to callers, so anything that copies entries (migration, backup/restore) cannot preserve expiry. A backend that overrides get_kv_ttl must override this too (return true), otherwise it is treated as TTL-blind.

Source

fn encrypts_kv_at_rest(&self) -> bool

Whether this storage encrypts KV values at rest itself (i.e. it is, or wraps, an EncryptedStorage). false (the default) means values reach the backend as given. A wrapper around an EncryptedStorage must forward this, or startup will wrongly report its values as unencrypted.

Source

fn list_kv_keys<'life0, 'life1, 'async_trait>( &'life0 self, _prefix: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

List keys with a specific prefix.

Important: All storage backends must override this method to return real key data. The default returns an empty Vec for backward compatibility but will cause analytics, compliance, and RBAC queries to operate on empty data.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl AuthStorage for Arc<dyn AuthStorage>

Lets a boxed Arc<dyn AuthStorage> coming out of the storage factory be wrapped in crate::storage::encryption::EncryptedStorage without downcasting to a concrete backend type first.

Deliberately scoped to the trait-object case only (Arc<dyn AuthStorage>), not a generic impl<T: AuthStorage + ?Sized> AuthStorage for Arc<T>: a generic impl would apply to every Arc<ConcreteBackend> too, and Rust’s method resolution prefers an exact-type impl over autoderef – so some_arc.get_session(..) would resolve to this impl’s (**self).get_session(..) indirection instead of calling ConcreteBackend::get_session directly, adding an extra async_trait boxed-future hop to every storage call made through an Arc<Concrete> anywhere in the crate (including benchmarks and tests), not just the one factory path that actually needs this. Measured: this cost a real ~20-30% regression on the session_operations/get_session benchmark before being scoped down to dyn AuthStorage here.

Source§

fn store_tokens_bulk<'life0, 'life1, 'async_trait>( &'life0 self, tokens: &'life1 [AuthToken], ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn delete_tokens_bulk<'life0, 'life1, 'async_trait>( &'life0 self, token_ids: &'life1 [String], ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn store_sessions_bulk<'life0, 'life1, 'async_trait>( &'life0 self, sessions: &'life1 [(String, SessionData)], ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn delete_sessions_bulk<'life0, 'life1, 'async_trait>( &'life0 self, session_ids: &'life1 [String], ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn store_token<'life0, 'life1, 'async_trait>( &'life0 self, token: &'life1 AuthToken, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn get_token<'life0, 'life1, 'async_trait>( &'life0 self, token_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<AuthToken>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn get_token_by_access_token<'life0, 'life1, 'async_trait>( &'life0 self, access_token: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<AuthToken>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn update_token<'life0, 'life1, 'async_trait>( &'life0 self, token: &'life1 AuthToken, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn delete_token<'life0, 'life1, 'async_trait>( &'life0 self, token_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn list_user_tokens<'life0, 'life1, 'async_trait>( &'life0 self, user_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<AuthToken>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn store_session<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, session_id: &'life1 str, data: &'life2 SessionData, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source§

fn get_session<'life0, 'life1, 'async_trait>( &'life0 self, session_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<SessionData>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn delete_session<'life0, 'life1, 'async_trait>( &'life0 self, session_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn list_user_sessions<'life0, 'life1, 'async_trait>( &'life0 self, user_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<SessionData>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn count_active_sessions<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn store_kv<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, key: &'life1 str, value: &'life2 [u8], ttl: Option<Duration>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source§

fn store_kv_if_absent<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, key: &'life1 str, value: &'life2 [u8], ttl: Option<Duration>, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source§

fn get_kv<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn get_kv_ttl<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<Duration>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn tracks_kv_ttl(&self) -> bool

Source§

fn delete_kv<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn encrypts_kv_at_rest(&self) -> bool

Source§

fn list_kv_keys<'life0, 'life1, 'async_trait>( &'life0 self, prefix: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn cleanup_expired<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§