pub struct RopeStore {Show 13 fields
pub rope: RwLock<Rope>,
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 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 format_runs: RwLock<HashMap<EntityId, Vec<FormatRun>>>,
pub block_images: RwLock<HashMap<EntityId, Vec<ImageAnchor>>>,
pub block_offsets: RwLock<BlockOffsetIndex>,
pub counters: RwLock<HashMap<String, EntityId>>,
/* private fields */
}Fields§
§rope: RwLock<Rope>§roots: RwLock<HashMap<EntityId, Root>>§documents: RwLock<HashMap<EntityId, Document>>§frames: RwLock<HashMap<EntityId, Frame>>§blocks: RwLock<HashMap<EntityId, Block>>§lists: RwLock<HashMap<EntityId, List>>§resources: RwLock<HashMap<EntityId, Resource>>§tables: RwLock<HashMap<EntityId, Table>>§table_cells: RwLock<HashMap<EntityId, TableCell>>§format_runs: RwLock<HashMap<EntityId, Vec<FormatRun>>>§block_images: RwLock<HashMap<EntityId, Vec<ImageAnchor>>>§block_offsets: RwLock<BlockOffsetIndex>§counters: RwLock<HashMap<String, EntityId>>Implementations§
Source§impl RopeStore
impl RopeStore
pub fn new() -> Self
Sourcepub fn snapshot(&self) -> RopeStoreSnapshot
pub fn snapshot(&self) -> RopeStoreSnapshot
O(1) snapshot of the entire store (rope is Arc-shared, all
im::HashMaps are HAMT-shared; BlockOffsetIndex is a small
Vec cloned outright).
Sourcepub fn restore(&self, snap: &RopeStoreSnapshot)
pub fn restore(&self, snap: &RopeStoreSnapshot)
Restore from a snapshot. Overwrites counters too — used for
transaction rollback (Drop of an uncommitted write txn).
Sourcepub fn restore_without_counters(&self, snap: &RopeStoreSnapshot)
pub fn restore_without_counters(&self, snap: &RopeStoreSnapshot)
Restore everything except counters — used for undo, where IDs must remain monotonically increasing across undo/redo cycles.
pub fn create_savepoint(&self) -> u64
pub fn restore_savepoint(&self, savepoint_id: u64)
pub fn discard_savepoint(&self, savepoint_id: u64)
Sourcepub fn store_snapshot(&self) -> StoreSnapshot
pub fn store_snapshot(&self) -> StoreSnapshot
Type-erased store snapshot (for the generic undo path).
Sourcepub fn restore_store_snapshot(&self, snap: &StoreSnapshot)
pub fn restore_store_snapshot(&self, snap: &StoreSnapshot)
Restore from a type-erased store snapshot (undo semantic — counters preserved).
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for RopeStore
impl RefUnwindSafe for RopeStore
impl Send for RopeStore
impl Sync for RopeStore
impl Unpin for RopeStore
impl UnsafeUnpin for RopeStore
impl UnwindSafe for RopeStore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more