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> Forget for GenericVersionControlDecorator<B, L>
impl<B, L> Freeze for GenericVersionControlDecorator<B, L>where
*const u8 is !null: Freeze,
PhantomData<(u32, GenericLink<u32>)>: Freeze,
PhantomData<((u32, u32), BTreeSet<u32>)>: Freeze,
PhantomData<(u32, BTreeSet<u32>)>: Freeze,
PhantomData<(u32, String)>: Freeze,
PhantomData<(String, u32)>: Freeze,
PhantomData<u32>: Freeze,
PhantomData<u8>: Freeze,
L: Freeze,
PhantomData<JournalRecord<u32>>: Freeze,
PhantomData<(u128, ())>: Freeze,
PhantomData<(i64, ())>: Freeze,
PhantomData<GenericLink<u32>>: Freeze,
*const LeafNode<u32, String> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(u32, String)>>: Freeze,
B: Freeze,
PhantomData<(String, BranchInfo)>: Freeze,
*const LeafNode<String, i64> is !null: Freeze,
PhantomData<Box<(String, i64)>>: Freeze,
*const LeafNode<i64, String> is !null: Freeze,
PhantomData<Box<(i64, String)>>: Freeze,
impl<B, L> Move for GenericVersionControlDecorator<B, L>
impl<B, L> RefUnwindSafe for GenericVersionControlDecorator<B, L>where
L: RefUnwindSafe,
B: RefUnwindSafe,
impl<B, L> Send for GenericVersionControlDecorator<B, L>where
L: Send,
B: Send,
RawTable<(u32, GenericLink<u32>)>: Send,
RawTable<((u32, u32), BTreeSet<u32>)>: Send,
RawTable<(u32, BTreeSet<u32>)>: Send,
RawTable<(u32, String)>: Send,
RawTable<(String, u32)>: Send,
RawVecInner: Send,
RawTable<(u128, ())>: Send,
RawTable<(i64, ())>: Send,
NodeRef<Owned, u32, String, LeafOrInternal>: Send,
BoxRaw<(u32, String)>: Send,
RawTable<(String, BranchInfo)>: Send,
NodeRef<Owned, String, i64, LeafOrInternal>: Send,
BoxRaw<(String, i64)>: Send,
NodeRef<Owned, i64, String, LeafOrInternal>: Send,
BoxRaw<(i64, String)>: Send,
impl<B, L> Sync for GenericVersionControlDecorator<B, L>where
L: Sync,
B: Sync,
RawTable<(u32, GenericLink<u32>)>: Sync,
RawTable<((u32, u32), BTreeSet<u32>)>: Sync,
RawTable<(u32, BTreeSet<u32>)>: Sync,
RawTable<(u32, String)>: Sync,
RawTable<(String, u32)>: Sync,
RawVecInner: Sync,
RawTable<(u128, ())>: Sync,
RawTable<(i64, ())>: Sync,
NodeRef<Owned, u32, String, LeafOrInternal>: Sync,
BoxRaw<(u32, String)>: Sync,
RawTable<(String, BranchInfo)>: Sync,
NodeRef<Owned, String, i64, LeafOrInternal>: Sync,
BoxRaw<(String, i64)>: Sync,
NodeRef<Owned, i64, String, LeafOrInternal>: Sync,
BoxRaw<(i64, String)>: Sync,
impl<B, L> Unpin for GenericVersionControlDecorator<B, L>where
L: Unpin,
B: Unpin,
*const u8 is !null: Unpin,
*const LeafNode<u32, SetValZST> is !null: Unpin,
Box<(u32, SetValZST)>: Unpin,
*const LeafNode<u32, String> is !null: Unpin,
Box<(u32, String)>: Unpin,
*const LeafNode<String, i64> is !null: Unpin,
Box<(String, i64)>: Unpin,
*const LeafNode<i64, String> is !null: Unpin,
Box<(i64, String)>: Unpin,
impl<B, L> UnsafeUnpin for GenericVersionControlDecorator<B, L>where
*const u8 is !null: UnsafeUnpin,
PhantomData<(u32, GenericLink<u32>)>: UnsafeUnpin,
PhantomData<((u32, u32), BTreeSet<u32>)>: UnsafeUnpin,
PhantomData<(u32, BTreeSet<u32>)>: UnsafeUnpin,
PhantomData<(u32, String)>: UnsafeUnpin,
PhantomData<(String, u32)>: UnsafeUnpin,
PhantomData<u32>: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
L: UnsafeUnpin,
PhantomData<JournalRecord<u32>>: UnsafeUnpin,
PhantomData<(u128, ())>: UnsafeUnpin,
PhantomData<(i64, ())>: UnsafeUnpin,
PhantomData<GenericLink<u32>>: UnsafeUnpin,
*const LeafNode<u32, String> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(u32, String)>>: UnsafeUnpin,
B: UnsafeUnpin,
PhantomData<(String, BranchInfo)>: UnsafeUnpin,
*const LeafNode<String, i64> is !null: UnsafeUnpin,
PhantomData<Box<(String, i64)>>: UnsafeUnpin,
*const LeafNode<i64, String> is !null: UnsafeUnpin,
PhantomData<Box<(i64, String)>>: UnsafeUnpin,
impl<B, L> UnwindSafe for GenericVersionControlDecorator<B, L>where
HashMap<u32, GenericLink<u32>>: UnwindSafe,
HashMap<(u32, u32), BTreeSet<u32>>: UnwindSafe,
HashMap<u32, BTreeSet<u32>>: UnwindSafe,
HashMap<u32, String>: UnwindSafe,
HashMap<String, u32>: UnwindSafe,
RawVecInner: UnwindSafe,
L: UnwindSafe,
NonNull<u8>: UnwindSafe,
BTreeMap<u32, String>: UnwindSafe,
B: UnwindSafe,
HashMap<String, BranchInfo>: UnwindSafe,
BTreeMap<String, i64>: UnwindSafe,
BTreeMap<i64, String>: 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