pub struct GenericVersionControlDecorator<B: NamedTypeLinks, L: TransitionLogStore = NamedTypesDecorator> { /* private fields */ }Expand description
Version control over a replaceable metadata store using the common links API. The default alias keeps the existing mapped metadata store and public API.
L is the transitions log of the wrapped transactions layer; clink
uses the append-only FileTransitionLog.
Implementations§
Source§impl<B: NamedTypeLinks, L: TransitionLogStore> GenericVersionControlDecorator<B, L>
impl<B: NamedTypeLinks, L: TransitionLogStore> GenericVersionControlDecorator<B, L>
pub fn new( transactions: GenericTransactionsDecorator<u32, NamedTypesDecorator, L>, branches_store: B, trace: bool, ) -> Result<Self>
Sourcepub fn make_version_control_database_filename<P: AsRef<Path>>(p: P) -> PathBuf
pub fn make_version_control_database_filename<P: AsRef<Path>>(p: P) -> PathBuf
Conventional sidecar filename for the version-control store.
pub fn current_branch(&self) -> &str
pub fn current_sequence(&self) -> i64
pub fn list_branches(&self) -> Vec<BranchInfo>
pub fn try_get_tag(&self, name: &str) -> Option<i64>
pub fn save(&mut self) -> Result<()>
pub fn transactions( &self, ) -> &GenericTransactionsDecorator<u32, NamedTypesDecorator, L>
pub fn transactions_mut( &mut self, ) -> &mut GenericTransactionsDecorator<u32, NamedTypesDecorator, L>
pub fn branches_store(&self) -> &B
pub fn begin_transaction(&mut self) -> Result<TransactionHandle>
pub fn commit(&mut self) -> Result<()>
pub fn rollback(&mut self) -> Result<()>
pub fn create(&mut self, source: u32, target: u32) -> Result<u32>
pub fn update(&mut self, id: u32, source: u32, target: u32) -> Result<Link>
Sourcepub fn update_observed(
&mut self,
id: u32,
source: u32,
target: u32,
observer: ChangeObserver<'_>,
) -> Result<Link>
pub fn update_observed( &mut self, id: u32, source: u32, target: u32, observer: ChangeObserver<'_>, ) -> Result<Link>
Self::update, reporting every change the decorator stack made —
the deletion of a link merged into its duplicate included.
pub fn delete(&mut self, id: u32) -> Result<Link>
Sourcepub fn delete_observed(
&mut self,
id: u32,
observer: ChangeObserver<'_>,
) -> Result<Link>
pub fn delete_observed( &mut self, id: u32, observer: ChangeObserver<'_>, ) -> Result<Link>
Self::delete, reporting every change the decorator stack made —
cascaded deletions of usages included.
pub fn create_and_update(&mut self, source: u32, target: u32) -> Result<u32>
pub fn set_name(&mut self, id: u32, name: &str) -> Result<u32>
pub fn remove_name(&mut self, id: u32) -> Result<()>
pub fn exists(&self, id: u32) -> bool
pub fn get(&self, id: u32) -> Option<&Link>
pub fn all(&self) -> Vec<&Link> ⓘ
pub fn search(&self, source: u32, target: u32) -> Option<u32>
pub fn get_or_create(&mut self, source: u32, target: u32) -> Result<u32>
pub fn ensure_created(&mut self, id: u32) -> u32
Sourcepub fn try_ensure_created(&mut self, id: u32) -> Result<u32>
pub fn try_ensure_created(&mut self, id: u32) -> Result<u32>
Fallible explicit-address allocation, attributed like other writes.
pub fn branch(&mut self, name: &str, from: Option<i64>) -> Result<()>
pub fn switch_branch(&mut self, name: &str) -> Result<()>
pub fn checkout(&mut self, sequence: i64) -> Result<()>
pub fn tag(&mut self, name: &str, sequence: Option<i64>) -> Result<()>
pub fn recover(&mut self) -> Result<()>
Trait Implementations§
Source§impl<B: NamedTypeLinks, L: TransitionLogStore> NamedTypeLinks for GenericVersionControlDecorator<B, L>
impl<B: NamedTypeLinks, L: TransitionLogStore> NamedTypeLinks for GenericVersionControlDecorator<B, L>
Source§fn reserve_query_allocations(
&mut self,
processor: &QueryProcessor,
restriction: &LinoLink,
substitution: &LinoLink,
) -> Result<Option<HashSet<u32>>>
fn reserve_query_allocations( &mut self, processor: &QueryProcessor, restriction: &LinoLink, substitution: &LinoLink, ) -> Result<Option<HashSet<u32>>>
Reserve the actual allocation sequence without staging observable rows.
Backends with a recycling allocator may retain the legacy probe path.
Source§fn try_get_or_create(&mut self, source: u32, target: u32) -> Result<u32>
fn try_get_or_create(&mut self, source: u32, target: u32) -> Result<u32>
Fallible pair lookup/allocation for composable query and decorator writes.
Source§fn try_create(&mut self, source: u32, target: u32) -> Result<u32>
fn try_create(&mut self, source: u32, target: u32) -> Result<u32>
Fallible allocation for backends that can report transaction/address errors.
fn try_ensure_created(&mut self, id: u32) -> Result<u32>
fn create(&mut self, source: u32, target: u32) -> u32
fn ensure_created(&mut self, id: u32) -> u32
fn get_link(&mut self, id: u32) -> Option<Link>
fn exists(&mut self, id: u32) -> bool
Source§fn update_observed(
&mut self,
id: u32,
source: u32,
target: u32,
observer: ChangeObserver<'_>,
) -> Result<Link>
fn update_observed( &mut self, id: u32, source: u32, target: u32, observer: ChangeObserver<'_>, ) -> Result<Link>
Self::update, reporting every change the update caused. Read moreSource§fn delete_observed(
&mut self,
id: u32,
observer: ChangeObserver<'_>,
) -> Result<Link>
fn delete_observed( &mut self, id: u32, observer: ChangeObserver<'_>, ) -> Result<Link>
Self::delete, reporting every change the deletion caused. Read morefn all_links(&mut self) -> Vec<Link> ⓘ
fn search(&mut self, source: u32, target: u32) -> Option<u32>
fn get_or_create(&mut self, source: u32, target: u32) -> u32
fn get_name(&mut self, id: u32) -> Result<Option<String>>
fn set_name(&mut self, id: u32, name: &str) -> Result<u32>
fn get_by_name(&mut self, name: &str) -> Result<Option<u32>>
fn remove_name(&mut self, id: u32) -> 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 morefn 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<B, L> Freeze for GenericVersionControlDecorator<B, L>
impl<B, L> RefUnwindSafe for GenericVersionControlDecorator<B, L>where
B: RefUnwindSafe,
L: RefUnwindSafe,
impl<B, L> Send for GenericVersionControlDecorator<B, L>
impl<B, L> Sync for GenericVersionControlDecorator<B, L>
impl<B, L> Unpin for GenericVersionControlDecorator<B, L>
impl<B, L> UnsafeUnpin for GenericVersionControlDecorator<B, L>where
B: UnsafeUnpin,
L: UnsafeUnpin,
impl<B, L> UnwindSafe for GenericVersionControlDecorator<B, L>where
B: UnwindSafe,
L: 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