pub trait OAuthCredentialStorage: Send + Sync {
// Required methods
fn load_credential<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<OAuthCredential>, OAuthError>> + 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: OAuthCredential,
) -> Pin<Box<dyn Future<Output = Result<(), OAuthError>> + 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<(), OAuthError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn has_credential(&self, key: &str) -> bool;
}Expand description
Trait for loading and saving OAuth credentials, keyed by provider ID or credential key.
Implementations include OsKeyringStore (OS keychain, feature keyring)
and the in-memory FakeOAuthCredentialStore for tests.
Required Methods§
fn load_credential<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<OAuthCredential>, OAuthError>> + 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: OAuthCredential,
) -> Pin<Box<dyn Future<Output = Result<(), OAuthError>> + 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<(), OAuthError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn has_credential(&self, key: &str) -> bool
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".