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
impl CausalWorkspace
Sourcepub fn named_links(&mut self) -> CausalNamedLinks<'_>
pub fn named_links(&mut self) -> CausalNamedLinks<'_>
Borrow the standard query/named-store interface with checked u64 writes and a u128 wildcard outside the complete stored address domain.
pub fn new( versions: &[CausalVersion], first: u64, last: u64, policy: CausalConflictPolicy, options: CausalWorkspaceOptions, ) -> Result<Self, LinkError>
pub fn rows(&self) -> Vec<Row<u64>>
pub fn get_name(&self, id: u64) -> Option<String>
pub fn get_by_name(&self, name: &str) -> Option<u64>
pub fn set_name( &mut self, id: u64, name: Option<String>, ) -> Result<(), LinkError>
pub fn finish(&mut self) -> Result<Vec<CausalBatchEdit>, LinkError>
pub fn rollback(&mut self)
Trait Implementations§
Source§impl LinksStorage<u64> for CausalWorkspace
impl LinksStorage<u64> for CausalWorkspace
Source§fn create_link(&mut self, source: u64, target: u64) -> Result<u64, LinkError>
fn create_link(&mut self, source: u64, target: u64) -> Result<u64, LinkError>
Creates a link and returns its address. A uniqueness resolver may return
an existing link after removing the temporary allocation.
Source§fn ensure_link_created(&mut self, id: u64) -> Result<u64, LinkError>
fn ensure_link_created(&mut self, id: u64) -> Result<u64, LinkError>
Ensures a link exists at
index, creating placeholders as needed.Source§fn get_link(&self, id: u64) -> Option<GenericLink<u64>>
fn get_link(&self, id: u64) -> Option<GenericLink<u64>>
Returns the link stored at
index, if any.Source§fn update_link(
&mut self,
id: u64,
source: u64,
target: u64,
) -> Result<GenericLink<u64>, LinkError>
fn update_link( &mut self, id: u64, source: u64, target: u64, ) -> Result<GenericLink<u64>, LinkError>
Repoints
index at source/target, returning the previous state.Source§fn delete_link(&mut self, id: u64) -> Result<GenericLink<u64>, LinkError>
fn delete_link(&mut self, id: u64) -> Result<GenericLink<u64>, LinkError>
Deletes
index, returning the link that was removed.Source§fn create_link_observed(
&mut self,
source: T,
target: T,
observer: &mut dyn FnMut(GenericLink<T>, GenericLink<T>),
) -> Result<T, LinkError>
fn create_link_observed( &mut self, source: T, target: T, observer: &mut dyn FnMut(GenericLink<T>, GenericLink<T>), ) -> Result<T, LinkError>
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 moreSource§fn ensure_link_created_observed(
&mut self,
index: T,
observer: &mut dyn FnMut(GenericLink<T>, GenericLink<T>),
) -> Result<T, LinkError>
fn ensure_link_created_observed( &mut self, index: T, observer: &mut dyn FnMut(GenericLink<T>, GenericLink<T>), ) -> Result<T, LinkError>
Self::ensure_link_created, reporting every placeholder it creates. Read moreSource§fn link_exists(&self, index: T) -> bool
fn link_exists(&self, index: T) -> bool
Returns
true when a link exists at index.Source§fn restore_link(
&mut self,
index: T,
source: T,
target: T,
) -> Result<GenericLink<T>, LinkError>
fn restore_link( &mut self, index: T, source: T, target: T, ) -> Result<GenericLink<T>, LinkError>
Writes exactly this row for undo and replay, returning the previous state. Read more
Source§fn update_link_observed(
&mut self,
index: T,
source: T,
target: T,
observer: &mut dyn FnMut(GenericLink<T>, GenericLink<T>),
) -> Result<GenericLink<T>, LinkError>
fn update_link_observed( &mut self, index: T, source: T, target: T, observer: &mut dyn FnMut(GenericLink<T>, GenericLink<T>), ) -> Result<GenericLink<T>, LinkError>
Source§fn delete_link_observed(
&mut self,
index: T,
observer: &mut dyn FnMut(GenericLink<T>, GenericLink<T>),
) -> Result<GenericLink<T>, LinkError>
fn delete_link_observed( &mut self, index: T, observer: &mut dyn FnMut(GenericLink<T>, GenericLink<T>), ) -> Result<GenericLink<T>, LinkError>
Source§fn query_links(
&self,
index: Option<T>,
source: Option<T>,
target: Option<T>,
) -> Vec<GenericLink<T>>
fn query_links( &self, index: Option<T>, source: Option<T>, target: Option<T>, ) -> Vec<GenericLink<T>>
Returns every link matching the (optional) index/source/target pattern.
Source§fn search_link(&self, source: T, target: T) -> Option<T>
fn search_link(&self, source: T, target: T) -> Option<T>
Finds the address of a link with the given source and target.
Source§fn get_or_create_link(&mut self, source: T, target: T) -> Result<T, LinkError>
fn get_or_create_link(&mut self, source: T, target: T) -> Result<T, LinkError>
Returns the address of an existing
(source, target) link,
creating it when it does not exist yet.Source§fn links_count(&self) -> usize
fn links_count(&self) -> usize
Number of links currently stored.
Source§fn capture_names(&mut self) -> Result<Option<BTreeMap<T, String>>, LinkError>
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.
Source§fn set_link_name(
&mut self,
_index: T,
_name: Option<&str>,
) -> Result<T, LinkError>
fn set_link_name( &mut self, _index: T, _name: Option<&str>, ) -> Result<T, LinkError>
Changes one logical name without recording. A named adapter must restore
external-reference names even when their row currently does not exist.
Auto Trait Implementations§
impl !Freeze for CausalWorkspace
impl RefUnwindSafe for CausalWorkspace
impl Send for CausalWorkspace
impl Sync for CausalWorkspace
impl Unpin for CausalWorkspace
impl UnsafeUnpin for CausalWorkspace
impl UnwindSafe for CausalWorkspace
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