use crate::config::GeoffreyAPIConfig; use crate::Result; use geoffrey_db::database::Database; use std::sync::Arc; pub struct Context { pub db: Database, pub cfg: GeoffreyAPIConfig, } impl Context { pub fn new(cfg: GeoffreyAPIConfig) -> Result> { let ctx = Self { db: Database::new(cfg.db_path.as_path()).unwrap(), cfg, }; Ok(Arc::new(ctx)) } }