Skip to main content

DeviceStore

Trait DeviceStore 

Source
pub trait DeviceStore: Send + Sync {
    // Required methods
    fn enroll_device<'life0, 'async_trait>(
        &'life0 self,
        record: DeviceRecord,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn link_device_user<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        fingerprint: &'life1 str,
        user_sub: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn get_device<'life0, 'life1, 'async_trait>(
        &'life0 self,
        fingerprint: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<DeviceRecord>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn touch_device<'life0, 'life1, 'async_trait>(
        &'life0 self,
        fingerprint: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn revoke_device<'life0, 'life1, 'async_trait>(
        &'life0 self,
        fingerprint: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Storage operations for anonymous device records.

Required Methods§

Source

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

Upsert a device record. On conflict (same fingerprint), updates enrolled_at but preserves any existing user_sub and label.

Associate a user subject with an existing device record.

Source

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

Retrieve a device record by fingerprint.

Source

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

Update last_seen_at to now.

Source

fn revoke_device<'life0, 'life1, 'async_trait>( &'life0 self, fingerprint: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Delete a device record. Returns true if the record existed.

Implementors§