pub struct WorkspaceManager { /* private fields */ }Implementations§
Source§impl WorkspaceManager
impl WorkspaceManager
Sourcepub const NO_GIT_SENTINEL: &'static str = "<no-git>"
pub const NO_GIT_SENTINEL: &'static str = "<no-git>"
Sentinel returned by checkpoint when git mode is Disabled.
pub fn new(root: impl Into<PathBuf>) -> Self
pub fn with_git(self, mode: GitWorktreeMode) -> Self
pub fn with_shell(self, shell: ShellRunner) -> Self
pub fn root(&self) -> &Path
pub fn git_mode(&self) -> &GitWorktreeMode
Sourcepub async fn ensure(&self, goal: &Goal) -> Result<PathBuf, DriverError>
pub async fn ensure(&self, goal: &Goal) -> Result<PathBuf, DriverError>
Resolve the goal’s workspace path, mkdir/worktree-add it, and
verify it stays inside root. Returns the absolute path the
harness will cwd into.
In SourceRepo mode, goal.workspace (operator-supplied) is
IGNORED — we always use <root>/<goal_id> so the worktree
branch name (nexo-driver/<goal_id>) lines up with the path.
Sourcepub async fn cleanup(&self, path: &Path) -> Result<(), DriverError>
pub async fn cleanup(&self, path: &Path) -> Result<(), DriverError>
Best-effort recursive remove. In SourceRepo mode, also
unregisters the worktree.
pub async fn checkpoint( &self, workspace: &Path, label: &str, ) -> Result<String, DriverError>
pub async fn rollback( &self, workspace: &Path, sha: &str, ) -> Result<(), DriverError>
pub async fn diff_stat( &self, workspace: &Path, since_sha: &str, ) -> Result<String, DriverError>
Auto Trait Implementations§
impl Freeze for WorkspaceManager
impl RefUnwindSafe for WorkspaceManager
impl Send for WorkspaceManager
impl Sync for WorkspaceManager
impl Unpin for WorkspaceManager
impl UnsafeUnpin for WorkspaceManager
impl UnwindSafe for WorkspaceManager
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