pub struct SimpleBackend { /* private fields */ }
Implementations§
Trait Implementations§
Source§impl Backend for SimpleBackend
impl Backend for SimpleBackend
fn as_any(&self) -> &dyn Any
Source§fn name(&self) -> &str
fn name(&self) -> &str
A unique name that identifies this backend. Written to
.jj/repo/store/backend
when the repo is created.Source§fn commit_id_length(&self) -> usize
fn commit_id_length(&self) -> usize
The length of commit IDs in bytes.
Source§fn change_id_length(&self) -> usize
fn change_id_length(&self) -> usize
The length of change IDs in bytes.
fn root_commit_id(&self) -> &CommitId
fn root_change_id(&self) -> &ChangeId
fn empty_tree_id(&self) -> &TreeId
Source§fn concurrency(&self) -> usize
fn concurrency(&self) -> usize
An estimate of how many concurrent requests this backend handles well. A
local backend like the Git backend (at until it supports partial clones)
may want to set this to 1. A cloud-backed backend may want to set it to
100 or so. Read more
fn read_file<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
path: &'life1 RepoPath,
id: &'life2 FileId,
) -> Pin<Box<dyn Future<Output = BackendResult<Pin<Box<dyn AsyncRead>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn write_file<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_path: &'life1 RepoPath,
contents: &'life2 mut (dyn AsyncRead + Send + Unpin),
) -> Pin<Box<dyn Future<Output = BackendResult<FileId>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn read_symlink<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_path: &'life1 RepoPath,
id: &'life2 SymlinkId,
) -> Pin<Box<dyn Future<Output = BackendResult<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn write_symlink<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_path: &'life1 RepoPath,
target: &'life2 str,
) -> Pin<Box<dyn Future<Output = BackendResult<SymlinkId>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Source§fn read_copy<'life0, 'life1, 'async_trait>(
&'life0 self,
_id: &'life1 CopyId,
) -> Pin<Box<dyn Future<Output = BackendResult<CopyHistory>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn read_copy<'life0, 'life1, 'async_trait>(
&'life0 self,
_id: &'life1 CopyId,
) -> Pin<Box<dyn Future<Output = BackendResult<CopyHistory>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Read the specified
CopyHistory
object. Read moreSource§fn write_copy<'life0, 'life1, 'async_trait>(
&'life0 self,
_contents: &'life1 CopyHistory,
) -> Pin<Box<dyn Future<Output = BackendResult<CopyId>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn write_copy<'life0, 'life1, 'async_trait>(
&'life0 self,
_contents: &'life1 CopyHistory,
) -> Pin<Box<dyn Future<Output = BackendResult<CopyId>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Write the
CopyHistory
object and return its ID. Read moreFind all copy histories that are related to the specified one. This is
defined as those that are ancestors of the given specified one, plus
their descendants. Children must be returned before parents. Read more
fn read_tree<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_path: &'life1 RepoPath,
id: &'life2 TreeId,
) -> Pin<Box<dyn Future<Output = BackendResult<Tree>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn write_tree<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_path: &'life1 RepoPath,
tree: &'life2 Tree,
) -> Pin<Box<dyn Future<Output = BackendResult<TreeId>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn read_conflict( &self, _path: &RepoPath, id: &ConflictId, ) -> BackendResult<Conflict>
fn write_conflict( &self, _path: &RepoPath, conflict: &Conflict, ) -> BackendResult<ConflictId>
fn read_commit<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 CommitId,
) -> Pin<Box<dyn Future<Output = BackendResult<Commit>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn write_commit<'life0, 'life1, 'async_trait>(
&'life0 self,
commit: Commit,
sign_with: Option<&'life1 mut SigningFn<'_>>,
) -> Pin<Box<dyn Future<Output = BackendResult<(CommitId, Commit)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn write_commit<'life0, 'life1, 'async_trait>(
&'life0 self,
commit: Commit,
sign_with: Option<&'life1 mut SigningFn<'_>>,
) -> Pin<Box<dyn Future<Output = BackendResult<(CommitId, Commit)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Writes a commit and returns its ID and the commit itself. The commit
should contain the data that was actually written, which may differ
from the data passed in. For example, the backend may change the
committer name to an authenticated user’s name, or the backend’s
timestamps may have less precision than the millisecond precision in
Commit
. Read moreSource§fn get_copy_records(
&self,
_paths: Option<&[RepoPathBuf]>,
_root: &CommitId,
_head: &CommitId,
) -> BackendResult<BoxStream<'_, BackendResult<CopyRecord>>>
fn get_copy_records( &self, _paths: Option<&[RepoPathBuf]>, _root: &CommitId, _head: &CommitId, ) -> BackendResult<BoxStream<'_, BackendResult<CopyRecord>>>
Get copy records for the dag range
root..head
. If paths
is None
include all paths, otherwise restrict to only paths
. Read moreSource§fn gc(&self, _index: &dyn Index, _keep_newer: SystemTime) -> BackendResult<()>
fn gc(&self, _index: &dyn Index, _keep_newer: SystemTime) -> BackendResult<()>
Perform garbage collection. Read more
Auto Trait Implementations§
impl Freeze for SimpleBackend
impl RefUnwindSafe for SimpleBackend
impl Send for SimpleBackend
impl Sync for SimpleBackend
impl Unpin for SimpleBackend
impl UnwindSafe for SimpleBackend
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