Trait mas_storage::RepositoryAccess
source · pub trait RepositoryAccess: Send {
type Error: Error + Send + Sync + 'static;
Show 21 methods
// Required methods
fn upstream_oauth_link<'c>(
&'c mut self,
) -> Box<dyn UpstreamOAuthLinkRepository<Error = Self::Error> + 'c>;
fn upstream_oauth_provider<'c>(
&'c mut self,
) -> Box<dyn UpstreamOAuthProviderRepository<Error = Self::Error> + 'c>;
fn upstream_oauth_session<'c>(
&'c mut self,
) -> Box<dyn UpstreamOAuthSessionRepository<Error = Self::Error> + 'c>;
fn user<'c>(
&'c mut self,
) -> Box<dyn UserRepository<Error = Self::Error> + 'c>;
fn user_email<'c>(
&'c mut self,
) -> Box<dyn UserEmailRepository<Error = Self::Error> + 'c>;
fn user_password<'c>(
&'c mut self,
) -> Box<dyn UserPasswordRepository<Error = Self::Error> + 'c>;
fn user_recovery<'c>(
&'c mut self,
) -> Box<dyn UserRecoveryRepository<Error = Self::Error> + 'c>;
fn user_terms<'c>(
&'c mut self,
) -> Box<dyn UserTermsRepository<Error = Self::Error> + 'c>;
fn browser_session<'c>(
&'c mut self,
) -> Box<dyn BrowserSessionRepository<Error = Self::Error> + 'c>;
fn app_session<'c>(
&'c mut self,
) -> Box<dyn AppSessionRepository<Error = Self::Error> + 'c>;
fn oauth2_client<'c>(
&'c mut self,
) -> Box<dyn OAuth2ClientRepository<Error = Self::Error> + 'c>;
fn oauth2_authorization_grant<'c>(
&'c mut self,
) -> Box<dyn OAuth2AuthorizationGrantRepository<Error = Self::Error> + 'c>;
fn oauth2_session<'c>(
&'c mut self,
) -> Box<dyn OAuth2SessionRepository<Error = Self::Error> + 'c>;
fn oauth2_access_token<'c>(
&'c mut self,
) -> Box<dyn OAuth2AccessTokenRepository<Error = Self::Error> + 'c>;
fn oauth2_refresh_token<'c>(
&'c mut self,
) -> Box<dyn OAuth2RefreshTokenRepository<Error = Self::Error> + 'c>;
fn oauth2_device_code_grant<'c>(
&'c mut self,
) -> Box<dyn OAuth2DeviceCodeGrantRepository<Error = Self::Error> + 'c>;
fn compat_session<'c>(
&'c mut self,
) -> Box<dyn CompatSessionRepository<Error = Self::Error> + 'c>;
fn compat_sso_login<'c>(
&'c mut self,
) -> Box<dyn CompatSsoLoginRepository<Error = Self::Error> + 'c>;
fn compat_access_token<'c>(
&'c mut self,
) -> Box<dyn CompatAccessTokenRepository<Error = Self::Error> + 'c>;
fn compat_refresh_token<'c>(
&'c mut self,
) -> Box<dyn CompatRefreshTokenRepository<Error = Self::Error> + 'c>;
fn job<'c>(&'c mut self) -> Box<dyn JobRepository<Error = Self::Error> + 'c>;
}
Expand description
Access the various repositories the backend implements.
All the methods return a boxed trait object, which can be used to access a particular repository. The lifetime of the returned object is bound to the lifetime of the whole repository, so that only one mutable reference to the repository is used at a time.
When adding a new repository, you should add a new method to this trait, and
update the implementations for crate::MapErr
and Box<R>
below.
Note: this used to have generic associated types to avoid boxing all the repository traits, but that was removed because it made almost impossible to box the trait object. This might be a shortcoming of the initial implementation of generic associated types, and might be fixed in the future.
Required Associated Types§
Required Methods§
sourcefn upstream_oauth_link<'c>(
&'c mut self,
) -> Box<dyn UpstreamOAuthLinkRepository<Error = Self::Error> + 'c>
fn upstream_oauth_link<'c>( &'c mut self, ) -> Box<dyn UpstreamOAuthLinkRepository<Error = Self::Error> + 'c>
Get an UpstreamOAuthLinkRepository
sourcefn upstream_oauth_provider<'c>(
&'c mut self,
) -> Box<dyn UpstreamOAuthProviderRepository<Error = Self::Error> + 'c>
fn upstream_oauth_provider<'c>( &'c mut self, ) -> Box<dyn UpstreamOAuthProviderRepository<Error = Self::Error> + 'c>
sourcefn upstream_oauth_session<'c>(
&'c mut self,
) -> Box<dyn UpstreamOAuthSessionRepository<Error = Self::Error> + 'c>
fn upstream_oauth_session<'c>( &'c mut self, ) -> Box<dyn UpstreamOAuthSessionRepository<Error = Self::Error> + 'c>
sourcefn user<'c>(&'c mut self) -> Box<dyn UserRepository<Error = Self::Error> + 'c>
fn user<'c>(&'c mut self) -> Box<dyn UserRepository<Error = Self::Error> + 'c>
Get an UserRepository
sourcefn user_email<'c>(
&'c mut self,
) -> Box<dyn UserEmailRepository<Error = Self::Error> + 'c>
fn user_email<'c>( &'c mut self, ) -> Box<dyn UserEmailRepository<Error = Self::Error> + 'c>
Get an UserEmailRepository
sourcefn user_password<'c>(
&'c mut self,
) -> Box<dyn UserPasswordRepository<Error = Self::Error> + 'c>
fn user_password<'c>( &'c mut self, ) -> Box<dyn UserPasswordRepository<Error = Self::Error> + 'c>
Get an UserPasswordRepository
sourcefn user_recovery<'c>(
&'c mut self,
) -> Box<dyn UserRecoveryRepository<Error = Self::Error> + 'c>
fn user_recovery<'c>( &'c mut self, ) -> Box<dyn UserRecoveryRepository<Error = Self::Error> + 'c>
Get an UserRecoveryRepository
sourcefn user_terms<'c>(
&'c mut self,
) -> Box<dyn UserTermsRepository<Error = Self::Error> + 'c>
fn user_terms<'c>( &'c mut self, ) -> Box<dyn UserTermsRepository<Error = Self::Error> + 'c>
Get an UserTermsRepository
sourcefn browser_session<'c>(
&'c mut self,
) -> Box<dyn BrowserSessionRepository<Error = Self::Error> + 'c>
fn browser_session<'c>( &'c mut self, ) -> Box<dyn BrowserSessionRepository<Error = Self::Error> + 'c>
Get a BrowserSessionRepository
sourcefn app_session<'c>(
&'c mut self,
) -> Box<dyn AppSessionRepository<Error = Self::Error> + 'c>
fn app_session<'c>( &'c mut self, ) -> Box<dyn AppSessionRepository<Error = Self::Error> + 'c>
Get a AppSessionRepository
sourcefn oauth2_client<'c>(
&'c mut self,
) -> Box<dyn OAuth2ClientRepository<Error = Self::Error> + 'c>
fn oauth2_client<'c>( &'c mut self, ) -> Box<dyn OAuth2ClientRepository<Error = Self::Error> + 'c>
Get an OAuth2ClientRepository
sourcefn oauth2_session<'c>(
&'c mut self,
) -> Box<dyn OAuth2SessionRepository<Error = Self::Error> + 'c>
fn oauth2_session<'c>( &'c mut self, ) -> Box<dyn OAuth2SessionRepository<Error = Self::Error> + 'c>
Get an OAuth2SessionRepository
sourcefn oauth2_access_token<'c>(
&'c mut self,
) -> Box<dyn OAuth2AccessTokenRepository<Error = Self::Error> + 'c>
fn oauth2_access_token<'c>( &'c mut self, ) -> Box<dyn OAuth2AccessTokenRepository<Error = Self::Error> + 'c>
Get an OAuth2AccessTokenRepository
sourcefn oauth2_refresh_token<'c>(
&'c mut self,
) -> Box<dyn OAuth2RefreshTokenRepository<Error = Self::Error> + 'c>
fn oauth2_refresh_token<'c>( &'c mut self, ) -> Box<dyn OAuth2RefreshTokenRepository<Error = Self::Error> + 'c>
Get an OAuth2RefreshTokenRepository
sourcefn oauth2_device_code_grant<'c>(
&'c mut self,
) -> Box<dyn OAuth2DeviceCodeGrantRepository<Error = Self::Error> + 'c>
fn oauth2_device_code_grant<'c>( &'c mut self, ) -> Box<dyn OAuth2DeviceCodeGrantRepository<Error = Self::Error> + 'c>
sourcefn compat_session<'c>(
&'c mut self,
) -> Box<dyn CompatSessionRepository<Error = Self::Error> + 'c>
fn compat_session<'c>( &'c mut self, ) -> Box<dyn CompatSessionRepository<Error = Self::Error> + 'c>
Get a CompatSessionRepository
sourcefn compat_sso_login<'c>(
&'c mut self,
) -> Box<dyn CompatSsoLoginRepository<Error = Self::Error> + 'c>
fn compat_sso_login<'c>( &'c mut self, ) -> Box<dyn CompatSsoLoginRepository<Error = Self::Error> + 'c>
Get a CompatSsoLoginRepository
sourcefn compat_access_token<'c>(
&'c mut self,
) -> Box<dyn CompatAccessTokenRepository<Error = Self::Error> + 'c>
fn compat_access_token<'c>( &'c mut self, ) -> Box<dyn CompatAccessTokenRepository<Error = Self::Error> + 'c>
sourcefn compat_refresh_token<'c>(
&'c mut self,
) -> Box<dyn CompatRefreshTokenRepository<Error = Self::Error> + 'c>
fn compat_refresh_token<'c>( &'c mut self, ) -> Box<dyn CompatRefreshTokenRepository<Error = Self::Error> + 'c>
sourcefn job<'c>(&'c mut self) -> Box<dyn JobRepository<Error = Self::Error> + 'c>
fn job<'c>(&'c mut self) -> Box<dyn JobRepository<Error = Self::Error> + 'c>
Get a JobRepository