kratad/db/
mod.rs

1use anyhow::Result;
2use redb::Database;
3use std::path::Path;
4use std::sync::Arc;
5
6pub mod network;
7pub mod zone;
8
9#[derive(Clone)]
10pub struct KrataDatabase {
11    pub database: Arc<Database>,
12}
13
14impl KrataDatabase {
15    pub fn open(path: &Path) -> Result<Self> {
16        let database = Database::create(path)?;
17        Ok(KrataDatabase {
18            database: Arc::new(database),
19        })
20    }
21}