pub struct Task {
pub id: String,
pub title: String,
pub description: Option<String>,
pub status: TaskStatus,
pub priority: u8,
pub blocked_by: Vec<String>,
pub loop_id: Option<String>,
pub created: String,
pub closed: Option<String>,
}Expand description
A task in the task tracking system.
Fields§
§id: StringUnique ID: task-{unix_timestamp}-{4_hex_chars}
title: StringShort description
description: Option<String>Optional detailed description
status: TaskStatusCurrent state
priority: u8Priority 1-5 (1 = highest)
blocked_by: Vec<String>Tasks that must complete before this one
loop_id: Option<String>Loop ID that created this task (from RALPH_LOOP_ID env var). Used to filter tasks by ownership when multiple loops share a task list.
created: StringCreation timestamp (ISO 8601)
closed: Option<String>Completion timestamp (ISO 8601), if closed
Implementations§
Source§impl Task
impl Task
Sourcepub fn new(title: String, priority: u8) -> Self
pub fn new(title: String, priority: u8) -> Self
Creates a new task with the given title and priority.
Sourcepub fn with_loop_id(self, loop_id: Option<String>) -> Self
pub fn with_loop_id(self, loop_id: Option<String>) -> Self
Sets the loop ID for this task.
Sourcepub fn generate_id() -> String
pub fn generate_id() -> String
Generates a unique task ID: task-{timestamp}-{hex_suffix}
Sourcepub fn is_ready(&self, all_tasks: &[Task]) -> bool
pub fn is_ready(&self, all_tasks: &[Task]) -> bool
Returns true if this task is ready to work on (open + no blockers pending).
Sourcepub fn with_description(self, description: Option<String>) -> Self
pub fn with_description(self, description: Option<String>) -> Self
Sets the description of the task.
Sourcepub fn with_blocker(self, task_id: String) -> Self
pub fn with_blocker(self, task_id: String) -> Self
Adds a blocker task ID.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Task
impl<'de> Deserialize<'de> for Task
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Task
impl RefUnwindSafe for Task
impl Send for Task
impl Sync for Task
impl Unpin for Task
impl UnwindSafe for Task
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