[][src]Trait my_iot::services::Service

pub trait Service: Send {
    fn spawn(
        self: Box<Self>,
        db: Arc<Mutex<Db>>,
        tx: &Sender<Message>,
        rx: &mut Bus<Message>
    ) -> Result<(), Error>; }

A generic service.

Required methods

fn spawn(
    self: Box<Self>,
    db: Arc<Mutex<Db>>,
    tx: &Sender<Message>,
    rx: &mut Bus<Message>
) -> Result<(), Error>

Spawn service threads.

Service may spawn as much threads as needed and must take care of their health.

  • db: database.
  • tx: message bus sender.
  • rx: message bus receiver.
Loading content...

Implementors

impl Service for Automator[src]

impl Service for Buienradar[src]

impl Service for Clock[src]

impl Service for Db[src]

impl Service for Nest[src]

Loading content...