soph_core/traits/
application.rsuse crate::{support::Container, traits::ServiceTrait, Result};
use async_trait::async_trait;
#[async_trait]
pub trait ApplicationTrait: 'static {
type Service: ServiceTrait;
#[cfg(feature = "migration")]
type Migrator: sea_orm_migration::MigratorTrait;
#[cfg(feature = "server")]
fn with_routing() -> impl ServiceTrait;
#[cfg(feature = "schedule")]
fn with_schedule() -> impl ServiceTrait;
#[cfg(feature = "console")]
fn with_console() -> impl ServiceTrait;
#[cfg(feature = "worker")]
fn with_worker() -> impl ServiceTrait;
fn configure() -> Result<()> {
#[cfg(not(feature = "tracing"))]
{
use tracing_subscriber::layer::SubscriberExt;
let subscriber = tracing_subscriber::registry()
.with(tracing_subscriber::fmt::layer().with_target(false));
let _ = tracing::subscriber::set_global_default(subscriber);
}
#[cfg(feature = "color-eyre")]
color_eyre::install()?;
Ok(())
}
async fn register(container: Container) -> Result<Container> {
Ok(container)
}
async fn boot() {}
}