1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use crate::{traits::ServiceTrait, Container, Result};

pub trait ApplicationTrait: Sync + Send {
    type Service: ServiceTrait;

    #[cfg(feature = "migration")]
    type Migrator: sea_orm_migration::MigratorTrait;

    #[cfg(any(feature = "http1", feature = "http2"))]
    fn with_routing() -> Box<dyn ServiceTrait>;

    #[cfg(feature = "schedule")]
    fn with_schedule() -> Box<dyn ServiceTrait>;

    #[cfg(feature = "console")]
    fn with_console() -> Box<dyn ServiceTrait>;

    fn register(container: Container) -> Result<Container> {
        Ok(container)
    }

    fn boot() {}
}