sylvia_iot_auth::models

Trait Model

Source
pub trait Model: Send + Sync {
    // Required methods
    fn close<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn StdError>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn user(&self) -> &dyn UserModel;
    fn client(&self) -> &dyn ClientModel;
    fn login_session(&self) -> &dyn LoginSessionModel;
    fn authorization_code(&self) -> &dyn AuthorizationCodeModel;
    fn access_token(&self) -> &dyn AccessTokenModel;
    fn refresh_token(&self) -> &dyn RefreshTokenModel;
}
Expand description

The top level trait to get all models (tables/collections).

Required Methods§

Source

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

Close database connection.

Source

fn user(&self) -> &dyn UserModel

To get the user model.

Source

fn client(&self) -> &dyn ClientModel

To get the client model.

Source

fn login_session(&self) -> &dyn LoginSessionModel

To get the login session model.

Source

fn authorization_code(&self) -> &dyn AuthorizationCodeModel

To get the authorization code model.

Source

fn access_token(&self) -> &dyn AccessTokenModel

To get the access token model.

Source

fn refresh_token(&self) -> &dyn RefreshTokenModel

To get the refresh token model.

Implementors§

Source§

impl Model for sylvia_iot_auth::models::MongoDbModel

Source§

impl Model for sylvia_iot_auth::models::SqliteModel