pub struct Workspace { /* private fields */ }
Expand description
Represents a workspace, i.e. what’s typically the .jj/ directory and its parent.
Implementations§
source§impl Workspace
impl Workspace
pub fn init_local( user_settings: &UserSettings, workspace_root: &Path ) -> Result<(Self, Arc<ReadonlyRepo>), WorkspaceInitError>
sourcepub fn init_internal_git(
user_settings: &UserSettings,
workspace_root: &Path
) -> Result<(Self, Arc<ReadonlyRepo>), WorkspaceInitError>
pub fn init_internal_git( user_settings: &UserSettings, workspace_root: &Path ) -> Result<(Self, Arc<ReadonlyRepo>), WorkspaceInitError>
Initializes a workspace with a new Git backend in .jj/git/ (bare Git repo)
sourcepub fn init_external_git(
user_settings: &UserSettings,
workspace_root: &Path,
git_repo_path: &Path
) -> Result<(Self, Arc<ReadonlyRepo>), WorkspaceInitError>
pub fn init_external_git( user_settings: &UserSettings, workspace_root: &Path, git_repo_path: &Path ) -> Result<(Self, Arc<ReadonlyRepo>), WorkspaceInitError>
Initializes a workspace with an existing Git backend at the specified path
pub fn init_with_factories( user_settings: &UserSettings, workspace_root: &Path, backend_factory: impl FnOnce(&Path) -> Result<Box<dyn Backend>, BackendInitError>, op_store_factory: impl FnOnce(&Path) -> Box<dyn OpStore>, op_heads_store_factory: impl FnOnce(&Path) -> Box<dyn OpHeadsStore>, index_store_factory: impl FnOnce(&Path) -> Box<dyn IndexStore>, submodule_store_factory: impl FnOnce(&Path) -> Box<dyn SubmoduleStore>, workspace_id: WorkspaceId ) -> Result<(Self, Arc<ReadonlyRepo>), WorkspaceInitError>
pub fn init_with_backend( user_settings: &UserSettings, workspace_root: &Path, backend_factory: impl FnOnce(&Path) -> Result<Box<dyn Backend>, BackendInitError> ) -> Result<(Self, Arc<ReadonlyRepo>), WorkspaceInitError>
pub fn init_workspace_with_existing_repo( user_settings: &UserSettings, workspace_root: &Path, repo: &Arc<ReadonlyRepo>, workspace_id: WorkspaceId ) -> Result<(Self, Arc<ReadonlyRepo>), WorkspaceInitError>
pub fn load( user_settings: &UserSettings, workspace_path: &Path, store_factories: &StoreFactories ) -> Result<Self, WorkspaceLoadError>
pub fn workspace_root(&self) -> &PathBuf
pub fn workspace_id(&self) -> &WorkspaceId
pub fn repo_path(&self) -> &PathBuf
pub fn repo_loader(&self) -> &RepoLoader
pub fn working_copy(&self) -> &WorkingCopy
pub fn working_copy_mut(&mut self) -> &mut WorkingCopy
Auto Trait Implementations§
impl !RefUnwindSafe for Workspace
impl Send for Workspace
impl !Sync for Workspace
impl Unpin for Workspace
impl !UnwindSafe for Workspace
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