de-global services

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2024-07-27 07:17:07 +00:00
parent 7e50db4193
commit 2f85a5c1ac
36 changed files with 327 additions and 336 deletions

View file

@ -11,12 +11,12 @@ pub struct Database {
impl Database {
/// Load an existing database or create a new one.
pub async fn open(server: &Arc<Server>) -> Result<Self> {
pub async fn open(server: &Arc<Server>) -> Result<Arc<Self>> {
let db = Engine::open(server)?;
Ok(Self {
Ok(Arc::new(Self {
db: db.clone(),
map: maps::open(&db)?,
})
}))
}
#[inline]