Macro kubos_app::app_main[][src]

macro_rules! app_main {
    ($handler:expr) => { ... };
}

A helper macro which detects the requested run level and calls the appropriate handler function

Arguments

Examples

#[macro_use]
extern crate kubos_app;

use kubos_app::AppHandler;

struct MyApp;

impl AppHandler for MyApp {
  fn on_boot(&self) {
    println!("OnBoot logic");
  }
  fn on_command(&self) {
    println!("OnCommand logic");
  }
}

fn main() {
    let app = MyApp { };
    app_main!(&app);
}