1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use crate::client::Exocore;
pub trait App: Send {
fn start(&self, client: &Exocore) -> Result<(), AppError>;
}
pub fn __exocore_app_register(app: Box<dyn App>) {
let exocore = Exocore::get();
exocore.register_app(app);
}
pub(crate) fn boot_app() {
let exocore = Exocore::get();
exocore.with_app(|app| app.start(exocore).expect("Failed to start application"))
}
#[derive(Debug, thiserror::Error)]
pub enum AppError {
#[error(transparent)]
Other(#[from] anyhow::Error),
}