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) -> Arc<Self>
pub fn backend(&self) -> &dyn Backend
pub fn backend_impl(&self) -> &dyn Any
pub fn signer(&self) -> &Signer
pub fn get_copy_records( &self, paths: Option<&[RepoPathBuf]>, root: &CommitId, head: &CommitId, ) -> BackendResult<BoxStream<'_, BackendResult<CopyRecord>>>
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 async fn write_commit( self: &Arc<Self>, commit: Commit, sign_with: Option<&mut SigningFn<'_>>, ) -> BackendResult<Commit>
pub fn get_tree( self: &Arc<Self>, dir: RepoPathBuf, id: &TreeId, ) -> BackendResult<Tree>
pub async fn get_tree_async( self: &Arc<Self>, dir: RepoPathBuf, id: &TreeId, ) -> BackendResult<Tree>
pub fn get_root_tree( self: &Arc<Self>, id: &MergedTreeId, ) -> BackendResult<MergedTree>
pub async fn write_tree( self: &Arc<Self>, path: &RepoPath, tree: Tree, ) -> BackendResult<Tree>
pub async fn read_file( &self, path: &RepoPath, id: &FileId, ) -> BackendResult<Pin<Box<dyn AsyncRead>>>
pub async fn write_file( &self, path: &RepoPath, contents: &mut (dyn AsyncRead + Send + Unpin), ) -> BackendResult<FileId>
pub async fn read_symlink( &self, path: &RepoPath, id: &SymlinkId, ) -> BackendResult<String>
pub async 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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more