1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
mod log;

mod boot;
use std::path::Path;

pub use boot::boot;
use cgp::core::async_trait;
use hermes_runtime::types::runtime::HermesRuntime;

use crate::command::CommandRunner;
use crate::config::Config;
use crate::output::Output;
use crate::Result;

#[async_trait]
pub trait Application: Sized {
    type Config: Config;

    type App;

    type Command: CommandRunner<Self::App>;

    fn parse_from_env() -> Self;

    fn config_path(&self) -> &Path;

    fn json_output(&self) -> bool;

    async fn run(&self, runtime: HermesRuntime) -> Result<Output>;
}