Skip to main content

text_document_common/database/
db_context.rs

1use crate::database::hashmap_store::HashMapStore;
2use std::sync::Arc;
3
4#[derive(Clone, Debug)]
5pub struct DbContext {
6    store: Arc<HashMapStore>,
7}
8
9impl DbContext {
10    pub fn new() -> Result<Self, crate::error::RepositoryError> {
11        Ok(DbContext {
12            store: Arc::new(HashMapStore::default()),
13        })
14    }
15
16    pub fn get_store(&self) -> &Arc<HashMapStore> {
17        &self.store
18    }
19}