pub struct DocStore { /* private fields */ }Expand description
A document store with one private provider-neutral session.
Implementations§
Source§impl DocStore
impl DocStore
Sourcepub fn create(path: &Path) -> StoreResult<Self>
pub fn create(path: &Path) -> StoreResult<Self>
Opens or creates an exactly compatible store.
Sourcepub fn open_read_only(path: &Path) -> StoreResult<Self>
pub fn open_read_only(path: &Path) -> StoreResult<Self>
Opens a legacy store without write authority or stamping it.
Sourcepub fn save_doc(&self, doc: &Doc) -> StoreResult<()>
pub fn save_doc(&self, doc: &Doc) -> StoreResult<()>
Saves a document snapshot.
Sourcepub fn load_doc(&self, id: &DocId) -> StoreResult<Option<Doc>>
pub fn load_doc(&self, id: &DocId) -> StoreResult<Option<Doc>>
Loads a document snapshot by id.
Sourcepub fn project_commit(
&self,
doc: &DocId,
edit: &Edit,
seq: u64,
) -> StoreResult<u64>
pub fn project_commit( &self, doc: &DocId, edit: &Edit, seq: u64, ) -> StoreResult<u64>
Records a projected ledger commit.
Source§impl DocStore
impl DocStore
Sourcepub fn save_web_capture(&mut self, row: &WebCaptureRow) -> StoreResult<()>
pub fn save_web_capture(&mut self, row: &WebCaptureRow) -> StoreResult<()>
Saves a capture, rejecting an id already bound to different bytes.
Sourcepub fn save_web_representation(
&mut self,
row: &WebRepresentationRow,
) -> StoreResult<()>
pub fn save_web_representation( &mut self, row: &WebRepresentationRow, ) -> StoreResult<()>
Saves a representation whose capture must already exist.
Sourcepub fn load_web_representation(
&self,
id: &str,
) -> StoreResult<Option<WebRepresentationRow>>
pub fn load_web_representation( &self, id: &str, ) -> StoreResult<Option<WebRepresentationRow>>
Loads representation fields used to revalidate an anchor.
Sourcepub fn load_web_capture(&self, id: &str) -> StoreResult<Option<WebCaptureRow>>
pub fn load_web_capture(&self, id: &str) -> StoreResult<Option<WebCaptureRow>>
Loads capture provenance fields.
Sourcepub fn save_web_anchor(&mut self, row: &WebAnchorRow) -> StoreResult<()>
pub fn save_web_anchor(&mut self, row: &WebAnchorRow) -> StoreResult<()>
Makes a validated anchor visible.
Sourcepub fn load_web_anchor(&self, id: &str) -> StoreResult<Option<WebAnchorRow>>
pub fn load_web_anchor(&self, id: &str) -> StoreResult<Option<WebAnchorRow>>
Loads an anchor row.
Auto Trait Implementations§
impl !Freeze for DocStore
impl !RefUnwindSafe for DocStore
impl !Send for DocStore
impl !Sync for DocStore
impl !UnwindSafe for DocStore
impl Unpin for DocStore
impl UnsafeUnpin for DocStore
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