pub struct ShardSession<T: LinkReference> { /* private fields */ }Expand description
Standard raw links operations in a selected shard. Commit the containing group explicitly; individual shard flushes cannot publish a partial group.
Implementations§
Source§impl<T: LinkReference> ShardSession<T>
impl<T: LinkReference> ShardSession<T>
pub fn get_name(&self, id: T) -> Option<String>
pub fn get_by_name(&self, name: &str) -> Option<T>
pub fn set_name(&mut self, id: T, name: Option<String>) -> Result<(), LinkError>
Sourcepub fn savepoint(&mut self) -> Result<Savepoint, LinkError>
pub fn savepoint(&mut self) -> Result<Savepoint, LinkError>
A savepoint covers this shard only, not the containing group.
pub fn rollback_to_savepoint( &mut self, savepoint: Savepoint, ) -> Result<(), LinkError>
pub fn release_savepoint( &mut self, savepoint: Savepoint, ) -> Result<(), LinkError>
Trait Implementations§
Source§impl<T: LinkReference> LinksStorage<T> for ShardSession<T>
impl<T: LinkReference> LinksStorage<T> for ShardSession<T>
Source§fn create_link(&mut self, source: T, target: T) -> Result<T, LinkError>
fn create_link(&mut self, source: T, target: T) -> Result<T, 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, index: T) -> Result<T, LinkError>
fn ensure_link_created(&mut self, index: T) -> Result<T, LinkError>
Ensures a link exists at
index, creating placeholders as needed.Source§fn get_link(&self, index: T) -> Option<GenericLink<T>>
fn get_link(&self, index: T) -> Option<GenericLink<T>>
Returns the link stored at
index, if any.Source§fn update_link(
&mut self,
index: T,
source: T,
target: T,
) -> Result<GenericLink<T>, LinkError>
fn update_link( &mut self, index: T, source: T, target: T, ) -> Result<GenericLink<T>, LinkError>
Repoints
index at source/target, returning the previous state.Source§fn delete_link(&mut self, index: T) -> Result<GenericLink<T>, LinkError>
fn delete_link(&mut self, index: T) -> Result<GenericLink<T>, LinkError>
Deletes
index, returning the link that was removed.Source§fn all_links(&self) -> Vec<GenericLink<T>>
fn all_links(&self) -> Vec<GenericLink<T>>
Returns every link in the store.
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.
Source§impl<T: QueryAddress> NamedTypeLinks<T> for ShardSession<T>
impl<T: QueryAddress> NamedTypeLinks<T> for ShardSession<T>
Source§fn reserve_query_allocations(
&mut self,
processor: &GenericQueryProcessor<T>,
restriction: &LinoLink,
substitution: &LinoLink,
) -> Result<Option<HashSet<T>>>
fn reserve_query_allocations( &mut self, processor: &GenericQueryProcessor<T>, restriction: &LinoLink, substitution: &LinoLink, ) -> Result<Option<HashSet<T>>>
Reserve the actual allocation sequence without staging observable rows.
Backends with a recycling allocator may retain the legacy probe path.
fn create(&mut self, source: T, target: T) -> T
Source§fn try_create(&mut self, source: T, target: T) -> Result<T>
fn try_create(&mut self, source: T, target: T) -> Result<T>
Fallible allocation for backends that can report transaction/address errors.
fn ensure_created(&mut self, id: T) -> T
fn try_ensure_created(&mut self, id: T) -> Result<T>
fn get_link(&mut self, id: T) -> Option<Link<T>>
fn exists(&mut self, id: T) -> bool
Source§fn update_observed(
&mut self,
id: T,
source: T,
target: T,
observer: ChangeObserver<'_, T>,
) -> Result<Link<T>>
fn update_observed( &mut self, id: T, source: T, target: T, observer: ChangeObserver<'_, T>, ) -> Result<Link<T>>
Self::update, reporting every change the update caused. Read moreSource§fn delete_observed(
&mut self,
id: T,
observer: ChangeObserver<'_, T>,
) -> Result<Link<T>>
fn delete_observed( &mut self, id: T, observer: ChangeObserver<'_, T>, ) -> Result<Link<T>>
Self::delete, reporting every change the deletion caused. Read morefn all_links(&mut self) -> Vec<Link<T>>
fn search(&mut self, source: T, target: T) -> Option<T>
fn get_or_create(&mut self, source: T, target: T) -> T
fn get_name(&mut self, id: T) -> Result<Option<String>>
fn set_name(&mut self, id: T, name: &str) -> Result<T>
fn get_by_name(&mut self, name: &str) -> Result<Option<T>>
fn remove_name(&mut self, id: T) -> Result<()>
fn save(&mut self) -> Result<()>
Source§fn query_limits(&self) -> Option<QueryLimits>
fn query_limits(&self) -> Option<QueryLimits>
A checked transport may restrict numeric input and query expansion.
Source§fn reference_exists(&mut self, id: T) -> bool
fn reference_exists(&mut self, id: T) -> bool
Whether a reference of a query to
id names a link that exists. Read moreSource§fn claims(&mut self, id: T) -> Option<bool>
fn claims(&mut self, id: T) -> Option<bool>
Whether
id is an address of this store, so a link created there
(Self::ensure_created, the undo of a delete) belongs in it; None
for a plain store, which has no addresses of its own. Read moreSource§fn next_created_addresses(&mut self, count: usize) -> Result<Vec<T>>
fn next_created_addresses(&mut self, count: usize) -> Result<Vec<T>>
The addresses the next
count links created in the store get. Read morefn update(&mut self, id: T, source: T, target: T) -> Result<GenericLink<T>>
fn delete(&mut self, id: T) -> Result<GenericLink<T>>
Source§fn query_links(
&mut self,
index: Option<T>,
source: Option<T>,
target: Option<T>,
) -> Vec<GenericLink<T>>
fn query_links( &mut self, index: Option<T>, source: Option<T>, target: Option<T>, ) -> Vec<GenericLink<T>>
The links that match a pattern, where
None matches any value, in
the order of their addresses. Read moreSource§fn try_get_or_create(&mut self, source: T, target: T) -> Result<T>
fn try_get_or_create(&mut self, source: T, target: T) -> Result<T>
Fallible pair lookup/allocation for composable query and decorator writes.
fn get_or_create_named(&mut self, name: &str) -> Result<T>
fn format_reference(&mut self, id: T) -> Result<String>
fn format_lino(&mut self, link: &GenericLink<T>) -> Result<String>
fn lino_lines(&mut self) -> Result<Vec<String>>
fn write_lino_output<P: AsRef<Path>>(&mut self, path: P) -> Result<()>where
Self: Sized,
fn print_all_lino(&mut self) -> Result<()>
fn print_change_lino( &mut self, before: &Option<GenericLink<T>>, after: &Option<GenericLink<T>>, ) -> Result<()>
fn format_structure(&mut self, id: T) -> Result<String>
fn format_structure_recursive( &mut self, id: T, visited: &mut HashSet<T>, ) -> Result<String>
Auto Trait Implementations§
impl<T> !Freeze for ShardSession<T>
impl<T> RefUnwindSafe for ShardSession<T>where
T: RefUnwindSafe,
impl<T> Send for ShardSession<T>
impl<T> Sync for ShardSession<T>
impl<T> Unpin for ShardSession<T>where
T: Unpin,
impl<T> UnsafeUnpin for ShardSession<T>
impl<T> UnwindSafe for ShardSession<T>where
T: RefUnwindSafe + UnwindSafe,
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