pub trait CredentialStore:
Send
+ Sync
+ Debug {
// Required methods
fn put<'life0, 'async_trait>(
&'life0 self,
record: CredentialRecord,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
scope: CredentialScope,
scope_id: &'life1 str,
provider_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<CredentialRecord>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn list<'life0, 'life1, 'async_trait>(
&'life0 self,
scope: CredentialScope,
scope_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<CredentialRecord>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn delete<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
scope: CredentialScope,
scope_id: &'life1 str,
provider_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
}Expand description
Backend-agnostic credential storage.
Required Methods§
Sourcefn put<'life0, 'async_trait>(
&'life0 self,
record: CredentialRecord,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn put<'life0, 'async_trait>(
&'life0 self,
record: CredentialRecord,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Insert or replace the credential for (scope, scope_id, provider_id).
Sourcefn get<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
scope: CredentialScope,
scope_id: &'life1 str,
provider_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<CredentialRecord>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
scope: CredentialScope,
scope_id: &'life1 str,
provider_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<CredentialRecord>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Fetch the credential for an exact (scope, scope_id, provider_id) key.
Sourcefn list<'life0, 'life1, 'async_trait>(
&'life0 self,
scope: CredentialScope,
scope_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<CredentialRecord>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn list<'life0, 'life1, 'async_trait>(
&'life0 self,
scope: CredentialScope,
scope_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<CredentialRecord>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
List all credentials at a (scope, scope_id) (e.g. all of a user’s keys).
Sourcefn delete<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
scope: CredentialScope,
scope_id: &'life1 str,
provider_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn delete<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
scope: CredentialScope,
scope_id: &'life1 str,
provider_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Delete the credential for (scope, scope_id, provider_id).
Returns true if a row was removed.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".