Skip to main content

DocStore

Struct DocStore 

Source
pub struct DocStore { /* private fields */ }
Expand description

A document store with one private provider-neutral session.

Implementations§

Source§

impl DocStore

Source

pub fn create(path: &Path) -> StoreResult<Self>

Opens or creates an exactly compatible store.

Source

pub fn open_read_only(path: &Path) -> StoreResult<Self>

Opens a legacy store without write authority or stamping it.

Source

pub fn save_doc(&self, doc: &Doc) -> StoreResult<()>

Saves a document snapshot.

Source

pub fn load_doc(&self, id: &DocId) -> StoreResult<Option<Doc>>

Loads a document snapshot by id.

Source

pub fn project_commit( &self, doc: &DocId, edit: &Edit, seq: u64, ) -> StoreResult<u64>

Records a projected ledger commit.

Source

pub fn undo_last(&self, doc: &DocId) -> StoreResult<Option<Edit>>

Returns the inverse edit for the latest projected ledger sequence.

Source§

impl DocStore

Source

pub fn save_web_capture(&mut self, row: &WebCaptureRow) -> StoreResult<()>

Saves a capture, rejecting an id already bound to different bytes.

Source

pub fn save_web_representation( &mut self, row: &WebRepresentationRow, ) -> StoreResult<()>

Saves a representation whose capture must already exist.

Source

pub fn load_web_representation( &self, id: &str, ) -> StoreResult<Option<WebRepresentationRow>>

Loads representation fields used to revalidate an anchor.

Source

pub fn load_web_capture(&self, id: &str) -> StoreResult<Option<WebCaptureRow>>

Loads capture provenance fields.

Source

pub fn save_web_anchor(&mut self, row: &WebAnchorRow) -> StoreResult<()>

Makes a validated anchor visible.

Source

pub fn load_web_anchor(&self, id: &str) -> StoreResult<Option<WebAnchorRow>>

Loads an anchor row.

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.