sylvia_iot_broker::models

Trait Model

Source
pub trait Model: 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 unit(&self) -> &dyn UnitModel;
    fn application(&self) -> &dyn ApplicationModel;
    fn network(&self) -> &dyn NetworkModel;
    fn device(&self) -> &dyn DeviceModel;
    fn device_route(&self) -> &dyn DeviceRouteModel;
    fn network_route(&self) -> &dyn NetworkRouteModel;
    fn dldata_buffer(&self) -> &dyn DlDataBufferModel;
}
Expand description

The top level trait to get all models (tables/collections).

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 unit(&self) -> &dyn UnitModel

To get the unit model.

Source

fn application(&self) -> &dyn ApplicationModel

To get the application model.

Source

fn network(&self) -> &dyn NetworkModel

To get the network model.

Source

fn device(&self) -> &dyn DeviceModel

To get the device model.

Source

fn device_route(&self) -> &dyn DeviceRouteModel

To get the device route model.

Source

fn network_route(&self) -> &dyn NetworkRouteModel

To get the network route model.

Source

fn dldata_buffer(&self) -> &dyn DlDataBufferModel

To get the downlink data buffer model.

Implementors§

Source§

impl Model for sylvia_iot_broker::models::MongoDbModel

Source§

impl Model for sylvia_iot_broker::models::SqliteModel