Skip to main content

DeviceCodeRepository

Trait DeviceCodeRepository 

Source
pub trait DeviceCodeRepository:
    Send
    + Sync
    + 'static {
    // Required methods
    fn create<'life0, 'async_trait>(
        &'life0 self,
        data: CreateDeviceCode,
    ) -> Pin<Box<dyn Future<Output = Result<DeviceCode>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn find_by_device_code_hash<'life0, 'life1, 'async_trait>(
        &'life0 self,
        hash: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<DeviceCode>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn find_by_user_code_hash<'life0, 'life1, 'async_trait>(
        &'life0 self,
        hash: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<DeviceCode>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn authorize<'life0, 'async_trait>(
        &'life0 self,
        id: Uuid,
        user_id: Uuid,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn deny<'life0, 'async_trait>(
        &'life0 self,
        id: Uuid,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn update_last_polled<'life0, 'async_trait>(
        &'life0 self,
        id: Uuid,
        interval_secs: u32,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn delete<'life0, 'async_trait>(
        &'life0 self,
        id: Uuid,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn delete_expired<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn list_by_client<'life0, 'life1, 'async_trait>(
        &'life0 self,
        client_id: &'life1 str,
        offset: u32,
        limit: u32,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<DeviceCode>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}

Required Methods§

Source

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

Source

fn find_by_device_code_hash<'life0, 'life1, 'async_trait>( &'life0 self, hash: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<DeviceCode>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn find_by_user_code_hash<'life0, 'life1, 'async_trait>( &'life0 self, hash: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<DeviceCode>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

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

Source

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

Source

fn update_last_polled<'life0, 'async_trait>( &'life0 self, id: Uuid, interval_secs: u32, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

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

Source

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

Source

fn list_by_client<'life0, 'life1, 'async_trait>( &'life0 self, client_id: &'life1 str, offset: u32, limit: u32, ) -> Pin<Box<dyn Future<Output = Result<Vec<DeviceCode>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Implementors§