Trait StorageBackend

Source
pub trait StorageBackend: Send + Sync {
    // Required methods
    fn load_keys<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<HashMap<String, ApiKey>, StorageError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn save_key<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 ApiKey,
    ) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn delete_key<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn save_all_keys<'life0, 'life1, 'async_trait>(
        &'life0 self,
        keys: &'life1 HashMap<String, ApiKey>,
    ) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Storage backend trait

Required Methods§

Source

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

Source

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

Source

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

Source

fn save_all_keys<'life0, 'life1, 'async_trait>( &'life0 self, keys: &'life1 HashMap<String, ApiKey>, ) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Implementors§