pub struct PoolState {
pub entries: Vec<PoolEntry>,
}Expand description
Snapshot of the pool state, derived from the filesystem
Fields§
§entries: Vec<PoolEntry>Implementations§
Source§impl PoolState
impl PoolState
Sourcepub fn scan(
worktrees_dir: &Path,
acquired_dir: &Path,
prefix: &str,
) -> Result<Self>
pub fn scan( worktrees_dir: &Path, acquired_dir: &Path, prefix: &str, ) -> Result<Self>
Scan the filesystem to build pool state.
worktrees_dir: path to.worktrees/acquired_dir: path to the acquired markers directoryprefix: directory name prefix to filter (e.g., “web-2-pool-”)
Sourcepub fn count_by_status(&self, status: &WorktreeStatus) -> usize
pub fn count_by_status(&self, status: &WorktreeStatus) -> usize
Count worktrees with a given status
Sourcepub fn find_available(&self) -> Option<&PoolEntry>
pub fn find_available(&self) -> Option<&PoolEntry>
Find the first available worktree
Sourcepub fn find_by_name_or_path(&self, identifier: &str) -> Option<&PoolEntry>
pub fn find_by_name_or_path(&self, identifier: &str) -> Option<&PoolEntry>
Find a worktree by name or path
Sourcepub fn next_name(&self, prefix: &str) -> String
pub fn next_name(&self, prefix: &str) -> String
Find the next pool name based on existing entries.
Returns {prefix}NNN (e.g., “web-2-pool-003”).
Sourcepub fn next_action(&self) -> PoolNextAction
pub fn next_action(&self) -> PoolNextAction
Determine the recommended next action
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PoolState
impl RefUnwindSafe for PoolState
impl Send for PoolState
impl Sync for PoolState
impl Unpin for PoolState
impl UnsafeUnpin for PoolState
impl UnwindSafe for PoolState
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