sylvia_iot_broker::models::device

Trait DeviceCache

Source
pub trait DeviceCache: Sync {
    // Required methods
    fn clear<'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,
        cond: &'life1 GetCacheQueryCond<'_>,
    ) -> Pin<Box<dyn Future<Output = Result<Option<DeviceCacheItem>, Box<dyn StdError>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn set<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        cond: &'life1 GetCacheQueryCond<'_>,
        value: Option<&'life2 DeviceCacheItem>,
    ) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn StdError>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn del<'life0, 'life1, 'async_trait>(
        &'life0 self,
        cond: &'life1 DelCacheQueryCond<'_>,
    ) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn StdError>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Cache operations.

Required Methods§

Source

fn clear<'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 clear all devices.

Source

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

To get device.

Source

fn set<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, cond: &'life1 GetCacheQueryCond<'_>, value: Option<&'life2 DeviceCacheItem>, ) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn StdError>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

To set device.

Source

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

To delete device.

Implementors§