sylvia_iot_auth::models::authorization_code

Trait AuthorizationCodeModel

Source
pub trait AuthorizationCodeModel: Sync {
    // Required methods
    fn init<'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 get<'life0, 'life1, 'async_trait>(
        &'life0 self,
        authorization_code: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<AuthorizationCode>, Box<dyn StdError>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn add<'life0, 'life1, 'async_trait>(
        &'life0 self,
        code: &'life1 AuthorizationCode,
    ) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn StdError>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn del<'life0, 'life1, 'async_trait>(
        &'life0 self,
        cond: &'life1 QueryCond<'_>,
    ) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn StdError>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Model operations.

Required Methods§

Source

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

To create and initialize the table/collection.

Source

fn get<'life0, 'life1, 'async_trait>( &'life0 self, authorization_code: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<AuthorizationCode>, Box<dyn StdError>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

To get an item.

Source

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

To add an item.

Source

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

To delete one or more items.

Implementors§