Skip to main content

SecretStore

Trait SecretStore 

Source
pub trait SecretStore:
    Debug
    + Send
    + Sync
    + 'static {
    // Required methods
    fn get<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 SecretKey,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Secret>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn set<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 SecretKey,
        value: Secret,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn delete<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 SecretKey,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Persistent credential storage.

Implementations must be safe to call from multiple tasks at once, and must pass the shared contract suite in [crate::contract].

Required Methods§

Source

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

Ok(None) when no secret is stored under key — a missing key is not an error.

Source

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

Store value, replacing any existing secret under key.

Source

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

Remove the secret. Deleting a missing key succeeds.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§