Skip to main content

CausalWorkspace

Struct CausalWorkspace 

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

A sealed standard-engine workspace with an independent reserved cursor. No ordinary engine handle or unguarded allocating callback escapes.

Implementations§

Source§

impl CausalWorkspace

Borrow the standard query/named-store interface with checked u64 writes and a u128 wildcard outside the complete stored address domain.

Source

pub fn new( versions: &[CausalVersion], first: u64, last: u64, policy: CausalConflictPolicy, options: CausalWorkspaceOptions, ) -> Result<Self, LinkError>

Source

pub fn rows(&self) -> Vec<Row<u64>>

Source

pub fn get_name(&self, id: u64) -> Option<String>

Source

pub fn get_by_name(&self, name: &str) -> Option<u64>

Source

pub fn set_name( &mut self, id: u64, name: Option<String>, ) -> Result<(), LinkError>

Source

pub fn finish(&mut self) -> Result<Vec<CausalBatchEdit>, LinkError>

Source

pub fn rollback(&mut self)

Trait Implementations§

Source§

impl LinksStorage<u64> for CausalWorkspace

Creates a link and returns its address. A uniqueness resolver may return an existing link after removing the temporary allocation.
Ensures a link exists at index, creating placeholders as needed.
Returns the link stored at index, if any.
Repoints index at source/target, returning the previous state.
Deletes index, returning the link that was removed.
Returns every link in the store.
Source§

fn flush(&mut self) -> Result<(), LinkError>

Makes every write durable on disk. Read more
Self::create_link, reporting every change, including partial changes before an error. Transactions need these callbacks to distinguish a new allocation from a duplicate resolved into an existing link. Read more
Self::ensure_link_created, reporting every placeholder it creates. Read more
Returns true when a link exists at index.
Writes exactly this row for undo and replay, returning the previous state. Read more
Self::update_link, reporting every (before, after) change it made. Read more
Self::delete_link, reporting every (before, after) change it made. Read more
Returns every link matching the (optional) index/source/target pattern.
Finds the address of a link with the given source and target.
Returns the address of an existing (source, target) link, creating it when it does not exist yet.
Number of links currently stored.
Source§

fn capture_names(&mut self) -> Result<Option<BTreeMap<T, String>>, LinkError>

Optional logical name snapshot for transactional undo. Unnamed stores return None without allocation. Include names of absent/external rows.
Changes one logical name without recording. A named adapter must restore external-reference names even when their row currently does not exist.
Source§

fn has_external_changes(&self) -> Result<bool, LinkError>

Cheap check for “did another process write to this database since we last read or wrote it?”. Read more
Source§

fn reload(&mut self) -> Result<(), LinkError>

Re-reads the database from disk, discarding cached state. 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> Same for T

Source§

type Output = T

Should always be Self
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.