pub struct LoopEntry {
pub id: String,
pub pid: u32,
pub started: DateTime<Utc>,
pub prompt: String,
pub worktree_path: Option<String>,
pub workspace: String,
}Expand description
Metadata for a registered loop.
Fields§
§id: StringUnique loop ID: loop-{unix_timestamp}-{4_hex_chars}
pid: u32Process ID of the loop.
started: DateTime<Utc>When the loop was started.
prompt: StringThe prompt/task being executed.
worktree_path: Option<String>Path to the worktree (None if running in main workspace).
workspace: StringThe workspace root where the loop is running.
Implementations§
Source§impl LoopEntry
impl LoopEntry
Sourcepub fn new(
prompt: impl Into<String>,
worktree_path: Option<impl Into<String>>,
) -> Self
pub fn new( prompt: impl Into<String>, worktree_path: Option<impl Into<String>>, ) -> Self
Creates a new loop entry for the current process.
Sourcepub fn with_workspace(
prompt: impl Into<String>,
worktree_path: Option<impl Into<String>>,
workspace: impl Into<String>,
) -> Self
pub fn with_workspace( prompt: impl Into<String>, worktree_path: Option<impl Into<String>>, workspace: impl Into<String>, ) -> Self
Creates a new loop entry with a specific workspace.
Sourcepub fn with_id(
id: impl Into<String>,
prompt: impl Into<String>,
worktree_path: Option<impl Into<String>>,
workspace: impl Into<String>,
) -> Self
pub fn with_id( id: impl Into<String>, prompt: impl Into<String>, worktree_path: Option<impl Into<String>>, workspace: impl Into<String>, ) -> Self
Creates a new loop entry with a specific ID.
Use this when you need the loop ID to match other identifiers (e.g., worktree name, branch name).
Sourcepub fn is_alive(&self) -> bool
pub fn is_alive(&self) -> bool
Checks if the process for this loop is still running.
For worktree loops, also verifies the worktree directory still exists. A process whose worktree has been removed externally is considered dead (zombie) even if the PID is still alive.
Sourcepub fn is_pid_alive(&self) -> bool
pub fn is_pid_alive(&self) -> bool
Checks if the PID is alive (regardless of worktree state).
Use this when you need to know if the process itself is running, e.g. to decide whether to send a signal.