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>, signer: Signer, use_tree_conflict_format: bool ) -> Arc<Self>
pub fn backend_impl(&self) -> &dyn Any
pub fn signer(&self) -> &Signer
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 root_commit_id(&self) -> &CommitId
pub fn root_change_id(&self) -> &ChangeId
pub fn empty_tree_id(&self) -> &TreeId
pub fn concurrency(&self) -> usize
pub fn empty_merged_tree_id(&self) -> MergedTreeId
pub fn root_commit(self: &Arc<Self>) -> Commit
pub fn get_commit(self: &Arc<Self>, id: &CommitId) -> BackendResult<Commit>
pub async fn get_commit_async( self: &Arc<Self>, id: &CommitId ) -> BackendResult<Commit>
pub fn write_commit( self: &Arc<Self>, commit: Commit, sign_with: Option<&mut SigningFn<'_>> ) -> BackendResult<Commit>
pub fn get_tree( self: &Arc<Self>, dir: &RepoPath, id: &TreeId ) -> BackendResult<Tree>
pub async fn get_tree_async( 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 async fn read_file_async( &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 async fn read_symlink_async( &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<MergedTreeValue>
pub fn write_conflict( &self, path: &RepoPath, contents: &MergedTreeValue ) -> BackendResult<ConflictId>
pub fn tree_builder(self: &Arc<Self>, base_tree_id: TreeId) -> TreeBuilder
pub fn gc(&self, index: &dyn Index, keep_newer: SystemTime) -> BackendResult<()>
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Store
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