use crate::core::{Config, router::RouterService};


pub struct AppState<T: 'static = ()> {
    pub(crate) router: RouterService,
    pub(crate) config: Config,
    pub(crate) user_state: &'static T,
}

pub struct App<T: 'static = ()> {
    pub(crate) state: &'static AppState<T>,
    pub(crate) server: pingora::server::Server,
}

impl<T> App<T> 
where
    T: Send + Sync + 'static 
{
    pub fn run(self) {
        self.server.run_forever();
    }
}