pub struct VersionControlDecorator { /* private fields */ }Expand description
Decorator that adds time travel, branching, and tagging over the
transitions log produced by a TransactionsDecorator.
Implementations§
Source§impl VersionControlDecorator
impl VersionControlDecorator
pub fn new( transactions: TransactionsDecorator, branches_store: NamedTypesDecorator, 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(&self) -> Result<()>
pub fn transactions(&self) -> &TransactionsDecorator
pub fn transactions_mut(&mut self) -> &mut TransactionsDecorator
pub fn branches_store(&self) -> &NamedTypesDecorator
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>
pub fn delete(&mut self, id: u32) -> Result<Link>
pub fn create_and_update(&mut self, source: u32, target: u32) -> Result<u32>
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
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 NamedTypeLinks for VersionControlDecorator
impl NamedTypeLinks for VersionControlDecorator
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
fn update(&mut self, id: u32, source: u32, target: u32) -> Result<Link>
fn delete(&mut self, id: u32) -> Result<Link>
fn 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<()>
fn try_ensure_created(&mut self, id: u32) -> Result<u32>
fn get_or_create_named(&mut self, name: &str) -> Result<u32>
fn format_reference(&mut self, id: u32) -> Result<String>
fn format_lino(&mut self, link: &Link) -> Result<String>
fn lino_lines(&mut self) -> Result<Vec<String>>
fn write_lino_output<P: AsRef<Path>>(&mut self, path: P) -> Result<()>
fn print_all_lino(&mut self) -> Result<()>
fn print_change_lino( &mut self, before: &Option<Link>, after: &Option<Link>, ) -> Result<()>
fn format_structure(&mut self, id: u32) -> Result<String>
fn format_structure_recursive( &mut self, id: u32, visited: &mut HashSet<u32>, ) -> Result<String>
Auto Trait Implementations§
impl Freeze for VersionControlDecorator
impl RefUnwindSafe for VersionControlDecorator
impl Send for VersionControlDecorator
impl Sync for VersionControlDecorator
impl Unpin for VersionControlDecorator
impl UnsafeUnpin for VersionControlDecorator
impl UnwindSafe for VersionControlDecorator
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