DevicePersistence

Trait DevicePersistence 

Source
pub trait DevicePersistence: Send + Sync {
    // Required methods
    fn save_device_data<'life0, 'life1, 'async_trait>(
        &'life0 self,
        device_data: &'life1 Device,
    ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             Self: 'async_trait;
    fn save_device_data_for_device<'life0, 'life1, 'async_trait>(
        &'life0 self,
        device_id: i32,
        device_data: &'life1 Device,
    ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             Self: 'async_trait;
    fn load_device_data<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Device>, StoreError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
    fn load_device_data_for_device<'life0, 'async_trait>(
        &'life0 self,
        device_id: i32,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Device>, StoreError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
    fn device_exists<'life0, 'async_trait>(
        &'life0 self,
        device_id: i32,
    ) -> Pin<Box<dyn Future<Output = Result<bool, StoreError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
    fn create_new_device<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<i32, StoreError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
}
Expand description

Trait for device data persistence operations

Required Methods§

Source

fn save_device_data<'life0, 'life1, 'async_trait>( &'life0 self, device_data: &'life1 Device, ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Save device data (single device mode)

Source

fn save_device_data_for_device<'life0, 'life1, 'async_trait>( &'life0 self, device_id: i32, device_data: &'life1 Device, ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Save device data for a specific device ID (multi-account mode)

Source

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

Load device data (single device mode)

Source

fn load_device_data_for_device<'life0, 'async_trait>( &'life0 self, device_id: i32, ) -> Pin<Box<dyn Future<Output = Result<Option<Device>, StoreError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Load device data for a specific device ID (multi-account mode)

Source

fn device_exists<'life0, 'async_trait>( &'life0 self, device_id: i32, ) -> Pin<Box<dyn Future<Output = Result<bool, StoreError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Check if a device row exists for the given device_id.

Source

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

Create a new device row and return its generated device_id.

Implementors§