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