use sqlx::PgPool; pub type AppState = std::sync::Arc>; pub struct AppInternalState { pub database: sqlx::postgres::PgPool, pub cache: cache::Cache, } impl AppInternalState { pub fn new(database: PgPool, cache: cache::Pool) -> Self { AppInternalState { database, cache: cache::Cache { inmem: cache }, } } }