pub trait CredentialService: Send + Sync {
// Required methods
fn load_credential<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<AuthCredential>, CredentialError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn save_credential<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
credential: AuthCredential,
) -> Pin<Box<dyn Future<Output = Result<(), CredentialError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn delete_credential<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), CredentialError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
Trait for credential persistence — load, save, delete.
Required Methods§
Sourcefn load_credential<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<AuthCredential>, CredentialError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load_credential<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<AuthCredential>, CredentialError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Load a credential by key. Returns None if not found.
Sourcefn save_credential<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
credential: AuthCredential,
) -> Pin<Box<dyn Future<Output = Result<(), CredentialError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn save_credential<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
credential: AuthCredential,
) -> Pin<Box<dyn Future<Output = Result<(), CredentialError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Save a credential under the given key.
Sourcefn delete_credential<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), CredentialError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_credential<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), CredentialError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Delete a credential by key.