pub struct Store { /* private fields */ }
Expand description
Wraps the low-level backend and makes it return more convenient types. Also adds caching.
Implementations§
source§impl Store
impl Store
pub fn new( backend: Box<dyn Backend>, use_tree_conflict_format: bool ) -> Arc<Self>
pub fn backend_impl(&self) -> &dyn Any
sourcepub fn use_tree_conflict_format(&self) -> bool
pub fn use_tree_conflict_format(&self) -> bool
Whether new tree should be written using the tree-level format.
pub fn commit_id_length(&self) -> usize
pub fn change_id_length(&self) -> usize
pub fn empty_tree_id(&self) -> &TreeId
pub fn empty_merged_tree_id(&self) -> MergedTreeId
pub fn root_commit_id(&self) -> &CommitId
pub fn root_change_id(&self) -> &ChangeId
pub fn root_commit(self: &Arc<Self>) -> Commit
pub fn get_commit(self: &Arc<Self>, id: &CommitId) -> BackendResult<Commit>
pub fn write_commit(self: &Arc<Self>, commit: Commit) -> BackendResult<Commit>
pub fn get_tree( self: &Arc<Self>, dir: &RepoPath, id: &TreeId ) -> BackendResult<Tree>
pub fn get_root_tree( self: &Arc<Self>, id: &MergedTreeId ) -> BackendResult<MergedTree>
pub fn write_tree( self: &Arc<Self>, path: &RepoPath, tree: Tree ) -> BackendResult<Tree>
pub fn read_file( &self, path: &RepoPath, id: &FileId ) -> BackendResult<Box<dyn Read>>
pub fn write_file( &self, path: &RepoPath, contents: &mut dyn Read ) -> BackendResult<FileId>
pub fn read_symlink( &self, path: &RepoPath, id: &SymlinkId ) -> BackendResult<String>
pub fn write_symlink( &self, path: &RepoPath, contents: &str ) -> BackendResult<SymlinkId>
pub fn read_conflict( &self, path: &RepoPath, id: &ConflictId ) -> BackendResult<Merge<Option<TreeValue>>>
pub fn write_conflict( &self, path: &RepoPath, contents: &Merge<Option<TreeValue>> ) -> BackendResult<ConflictId>
pub fn tree_builder(self: &Arc<Self>, base_tree_id: TreeId) -> TreeBuilder
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Store
impl Send for Store
impl Sync for Store
impl Unpin for Store
impl !UnwindSafe for Store
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