pub struct WorktreeStateManager { /* private fields */ }Expand description
Worktree state manager
Implementations§
Source§impl WorktreeStateManager
impl WorktreeStateManager
Sourcepub fn scan_worktrees(&self) -> Result<Vec<WorktreeState>>
pub fn scan_worktrees(&self) -> Result<Vec<WorktreeState>>
Scan all worktrees and return their states
Sourcepub fn get_worktree_state(&self, path: &Path) -> Result<WorktreeState>
pub fn get_worktree_state(&self, path: &Path) -> Result<WorktreeState>
Get the state of a specific worktree
Sourcepub fn find_orphaned_worktrees(&self) -> Result<Vec<WorktreeState>>
pub fn find_orphaned_worktrees(&self) -> Result<Vec<WorktreeState>>
Find orphaned worktrees (no corresponding TaskMetadata)
Sourcepub fn find_stuck_worktrees(
&self,
timeout: Duration,
) -> Result<Vec<WorktreeState>>
pub fn find_stuck_worktrees( &self, timeout: Duration, ) -> Result<Vec<WorktreeState>>
Find stuck worktrees (no activity for extended period)
Sourcepub fn cleanup_worktree(&self, path: &Path) -> Result<()>
pub fn cleanup_worktree(&self, path: &Path) -> Result<()>
Clean up a specific worktree
Sourcepub fn cleanup_orphaned(&self) -> Result<usize>
pub fn cleanup_orphaned(&self) -> Result<usize>
Clean up all orphaned worktrees
Sourcepub fn cleanup_all(&self) -> Result<usize>
pub fn cleanup_all(&self) -> Result<usize>
Clean up all known worktrees regardless of status
Sourcepub fn sync_with_metadata(&self) -> Result<()>
pub fn sync_with_metadata(&self) -> Result<()>
Synchronize worktree states with TaskMetadata
Auto Trait Implementations§
impl Freeze for WorktreeStateManager
impl RefUnwindSafe for WorktreeStateManager
impl Send for WorktreeStateManager
impl Sync for WorktreeStateManager
impl Unpin for WorktreeStateManager
impl UnwindSafe for WorktreeStateManager
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