pub struct Store { /* private fields */ }Expand description
Wraps the low-level backend and makes it return more convenient types. Also adds the root commit and adds caching.
Implementations§
Source§impl Store
impl Store
pub fn new(backend: Box<dyn Backend>) -> Arc<Self>
pub fn commit_id_length(&self) -> usize
pub fn change_id_length(&self) -> usize
pub fn git_repo(&self) -> Option<Repository>
pub fn empty_tree_id(&self) -> &TreeId
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 write_tree( &self, path: &RepoPath, contents: &Tree, ) -> BackendResult<TreeId>
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<Conflict>
pub fn write_conflict( &self, path: &RepoPath, contents: &Conflict, ) -> BackendResult<ConflictId>
pub fn tree_builder(self: &Arc<Self>, base_tree_id: TreeId) -> TreeBuilder
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