text-document-common 1.4.0

Shared entities, database, events, and undo/redo infrastructure for text-document
Documentation
use crate::database::hashmap_store::HashMapStore;
use std::sync::Arc;

#[derive(Clone, Debug)]
pub struct DbContext {
    store: Arc<HashMapStore>,
}

impl DbContext {
    pub fn new() -> Result<Self, crate::error::RepositoryError> {
        Ok(DbContext {
            store: Arc::new(HashMapStore::default()),
        })
    }

    pub fn get_store(&self) -> &Arc<HashMapStore> {
        &self.store
    }
}