Skip to main content

HashMapStore

Struct HashMapStore 

Source
pub struct HashMapStore {
Show 26 fields pub roots: RwLock<HashMap<EntityId, Root>>, pub documents: RwLock<HashMap<EntityId, Document>>, pub frames: RwLock<HashMap<EntityId, Frame>>, pub blocks: RwLock<HashMap<EntityId, Block>>, pub inline_elements: RwLock<HashMap<EntityId, InlineElement>>, pub lists: RwLock<HashMap<EntityId, List>>, pub resources: RwLock<HashMap<EntityId, Resource>>, pub tables: RwLock<HashMap<EntityId, Table>>, pub table_cells: RwLock<HashMap<EntityId, TableCell>>, pub jn_document_from_root_document: RwLock<HashMap<EntityId, Vec<EntityId>>>, pub jn_frame_from_document_frames: RwLock<HashMap<EntityId, Vec<EntityId>>>, pub jn_list_from_document_lists: RwLock<HashMap<EntityId, Vec<EntityId>>>, pub jn_resource_from_document_resources: RwLock<HashMap<EntityId, Vec<EntityId>>>, pub jn_table_from_document_tables: RwLock<HashMap<EntityId, Vec<EntityId>>>, pub jn_block_from_frame_blocks: RwLock<HashMap<EntityId, Vec<EntityId>>>, pub jn_frame_from_frame_parent_frame: RwLock<HashMap<EntityId, Vec<EntityId>>>, pub jn_table_from_frame_table: RwLock<HashMap<EntityId, Vec<EntityId>>>, pub jn_inline_element_from_block_elements: RwLock<HashMap<EntityId, Vec<EntityId>>>, pub jn_list_from_block_list: RwLock<HashMap<EntityId, Vec<EntityId>>>, pub jn_table_cell_from_table_cells: RwLock<HashMap<EntityId, Vec<EntityId>>>, pub jn_frame_from_table_cell_cell_frame: RwLock<HashMap<EntityId, Vec<EntityId>>>, pub jn_back_root_document: RwLock<HashMap<EntityId, Vec<EntityId>>>, pub jn_back_document_frames: RwLock<HashMap<EntityId, Vec<EntityId>>>, pub jn_back_frame_blocks: RwLock<HashMap<EntityId, Vec<EntityId>>>, pub jn_back_frame_parent_frame: RwLock<HashMap<EntityId, Vec<EntityId>>>, pub counters: RwLock<HashMap<String, EntityId>>, /* private fields */
}
Expand description

All document data, held in plain HashMaps behind RefCell for interior mutability. One instance per DbContext, shared by all tables within a transaction scope via &HashMapStore.

Fields§

§roots: RwLock<HashMap<EntityId, Root>>§documents: RwLock<HashMap<EntityId, Document>>§frames: RwLock<HashMap<EntityId, Frame>>§blocks: RwLock<HashMap<EntityId, Block>>§inline_elements: RwLock<HashMap<EntityId, InlineElement>>§lists: RwLock<HashMap<EntityId, List>>§resources: RwLock<HashMap<EntityId, Resource>>§tables: RwLock<HashMap<EntityId, Table>>§table_cells: RwLock<HashMap<EntityId, TableCell>>§jn_document_from_root_document: RwLock<HashMap<EntityId, Vec<EntityId>>>§jn_frame_from_document_frames: RwLock<HashMap<EntityId, Vec<EntityId>>>§jn_list_from_document_lists: RwLock<HashMap<EntityId, Vec<EntityId>>>§jn_resource_from_document_resources: RwLock<HashMap<EntityId, Vec<EntityId>>>§jn_table_from_document_tables: RwLock<HashMap<EntityId, Vec<EntityId>>>§jn_block_from_frame_blocks: RwLock<HashMap<EntityId, Vec<EntityId>>>§jn_frame_from_frame_parent_frame: RwLock<HashMap<EntityId, Vec<EntityId>>>§jn_table_from_frame_table: RwLock<HashMap<EntityId, Vec<EntityId>>>§jn_inline_element_from_block_elements: RwLock<HashMap<EntityId, Vec<EntityId>>>§jn_list_from_block_list: RwLock<HashMap<EntityId, Vec<EntityId>>>§jn_table_cell_from_table_cells: RwLock<HashMap<EntityId, Vec<EntityId>>>§jn_frame_from_table_cell_cell_frame: RwLock<HashMap<EntityId, Vec<EntityId>>>§jn_back_root_document: RwLock<HashMap<EntityId, Vec<EntityId>>>§jn_back_document_frames: RwLock<HashMap<EntityId, Vec<EntityId>>>§jn_back_frame_blocks: RwLock<HashMap<EntityId, Vec<EntityId>>>§jn_back_frame_parent_frame: RwLock<HashMap<EntityId, Vec<EntityId>>>§counters: RwLock<HashMap<String, EntityId>>

Implementations§

Source§

impl HashMapStore

Source

pub fn new() -> Self

Source

pub fn snapshot(&self) -> HashMapStoreSnapshot

Deep-clone the entire store for savepoint support.

Source

pub fn restore(&self, snap: &HashMapStoreSnapshot)

Restore from a savepoint snapshot.

Source

pub fn create_savepoint(&self) -> u64

Create a savepoint by snapshotting the entire store. Returns a savepoint id.

Source

pub fn restore_savepoint(&self, savepoint_id: u64)

Restore the store to a previously created savepoint.

Source

pub fn restore_without_counters(&self, snap: &HashMapStoreSnapshot)

Restore entity and junction data but preserve current counters. Used for undo snapshots where IDs must remain monotonically increasing.

Source

pub fn store_snapshot(&self) -> StoreSnapshot

Create a type-erased store snapshot for undo.

Source

pub fn restore_store_snapshot(&self, snap: &StoreSnapshot)

Restore from a type-erased store snapshot (preserves counters).

Trait Implementations§

Source§

impl Debug for HashMapStore

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for HashMapStore

Source§

fn default() -> HashMapStore

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.