pub struct RopeStore {Show 15 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_footnote_refs: RwLock<HashMap<EntityId, Vec<FootnoteRefAnchor>>>,
pub footnote_markers: RwLock<HashMap<String, String>>,
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_footnote_refs: RwLock<HashMap<EntityId, Vec<FootnoteRefAnchor>>>Footnote references anchored in each block, byte-ordered.
Beside block_images rather than merged with it: the two are written by
different editing paths and read together only through
format_runs::block_anchors, which is the one place their interleaving is
decided.
footnote_markers: RwLock<HashMap<String, String>>Host-supplied markers by footnote label — what a reference prints.
Ambient and presentation-only, like a syntax highlighter: never serialised, never part of the document, and consulted when a reference is rendered.
It exists because the number is a fact about the host’s manuscript, not about this document. Skribisto compiles one chapter into a document of its own, and that document’s reading order would number the chapter’s notes from one — disagreeing with the badge the writer sees in the editor, for the same note, at the same moment. Empty means “number them yourself”, which is the right answer for a document that is the whole text.
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).