sylvia_iot_broker::models

Trait Cache

Source
pub trait Cache: Send + Sync {
    // Required methods
    fn close<'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 device(&self) -> &dyn DeviceCache;
    fn device_route(&self) -> &dyn DeviceRouteCache;
    fn network_route(&self) -> &dyn NetworkRouteCache;
}
Expand description

The top level trait to get all caches.

Required Methods§

Source

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

Close database connection.

Source

fn device(&self) -> &dyn DeviceCache

To get the device cache.

Source

fn device_route(&self) -> &dyn DeviceRouteCache

To get the device route cache.

Source

fn network_route(&self) -> &dyn NetworkRouteCache

To get the network route cache.

Implementors§