pub struct RepoLoader { /* private fields */ }
Expand description
Helps create ReadonlyRepo
instances of a repo at the head operation or at
a given operation.
Implementations§
Source§impl RepoLoader
impl RepoLoader
pub fn new( settings: UserSettings, store: Arc<Store>, op_store: Arc<dyn OpStore>, op_heads_store: Arc<dyn OpHeadsStore>, index_store: Arc<dyn IndexStore>, submodule_store: Arc<dyn SubmoduleStore>, ) -> Self
Sourcepub fn init_from_file_system(
settings: &UserSettings,
repo_path: &Path,
store_factories: &StoreFactories,
) -> Result<Self, StoreLoadError>
pub fn init_from_file_system( settings: &UserSettings, repo_path: &Path, store_factories: &StoreFactories, ) -> Result<Self, StoreLoadError>
Creates a RepoLoader
for the repo at repo_path
by reading the
various .jj/repo/<backend>/type
files and loading the right
backends from store_factories
.
pub fn settings(&self) -> &UserSettings
pub fn store(&self) -> &Arc<Store>
pub fn index_store(&self) -> &Arc<dyn IndexStore>
pub fn op_store(&self) -> &Arc<dyn OpStore>
pub fn op_heads_store(&self) -> &Arc<dyn OpHeadsStore>
pub fn submodule_store(&self) -> &Arc<dyn SubmoduleStore>
pub fn load_at_head(&self) -> Result<Arc<ReadonlyRepo>, RepoLoaderError>
pub fn load_at( &self, op: &Operation, ) -> Result<Arc<ReadonlyRepo>, RepoLoaderError>
pub fn create_from( &self, operation: Operation, view: View, index: Box<dyn ReadonlyIndex>, ) -> Arc<ReadonlyRepo>
Sourcepub fn root_operation(&self) -> Operation
pub fn root_operation(&self) -> Operation
Returns the root operation.
Sourcepub fn load_operation(&self, id: &OperationId) -> OpStoreResult<Operation>
pub fn load_operation(&self, id: &OperationId) -> OpStoreResult<Operation>
Loads the specified operation from the operation store.
Sourcepub fn merge_operations(
&self,
operations: Vec<Operation>,
tx_description: Option<&str>,
) -> Result<Operation, RepoLoaderError>
pub fn merge_operations( &self, operations: Vec<Operation>, tx_description: Option<&str>, ) -> Result<Operation, RepoLoaderError>
Merges the given operations
into a single operation. Returns the root
operation if the operations
is empty.
Trait Implementations§
Source§impl Clone for RepoLoader
impl Clone for RepoLoader
Source§fn clone(&self) -> RepoLoader
fn clone(&self) -> RepoLoader
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for RepoLoader
impl !RefUnwindSafe for RepoLoader
impl Send for RepoLoader
impl Sync for RepoLoader
impl Unpin for RepoLoader
impl !UnwindSafe for RepoLoader
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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