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) -> Box<dyn Backend>, op_store_factory: impl FnOnce(&Path) -> Box<dyn OpStore>, op_heads_store_factory: impl FnOnce(&Path, &Arc<dyn OpStore>, &View, OperationMetadata) -> (Box<dyn OpHeadsStore>, Operation), ) -> Result<(Self, Arc<ReadonlyRepo>), WorkspaceInitError>
pub fn init_with_backend( user_settings: &UserSettings, workspace_root: &Path, backend_factory: impl FnOnce(&Path) -> Box<dyn Backend>, ) -> 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 !Freeze for Workspace
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
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