pub struct Task {Show 14 fields
pub id: String,
pub title: String,
pub description: String,
pub status: TaskStatus,
pub complexity: u32,
pub priority: Priority,
pub dependencies: Vec<String>,
pub parent_id: Option<String>,
pub subtasks: Vec<String>,
pub details: Option<String>,
pub test_strategy: Option<String>,
pub created_at: Option<String>,
pub updated_at: Option<String>,
pub assigned_to: Option<String>,
}Fields§
§id: String§title: String§description: String§status: TaskStatus§complexity: u32§priority: Priority§dependencies: Vec<String>§parent_id: Option<String>§subtasks: Vec<String>§details: Option<String>§test_strategy: Option<String>§created_at: Option<String>§updated_at: Option<String>§assigned_to: Option<String>Implementations§
Source§impl Task
impl Task
Sourcepub const ID_SEPARATOR: char = ':'
pub const ID_SEPARATOR: char = ':'
ID separator for namespaced IDs (epic:local_id)
pub fn new(id: String, title: String, description: String) -> Self
Sourcepub fn parse_id(id: &str) -> Option<(&str, &str)>
pub fn parse_id(id: &str) -> Option<(&str, &str)>
Parse a task ID into (epic_tag, local_id) parts e.g., “phase1:10.1” -> Some((“phase1”, “10.1”)) e.g., “10.1” -> None (legacy format)
Sourcepub fn is_subtask(&self) -> bool
pub fn is_subtask(&self) -> bool
Check if this is a subtask (has parent)
Sourcepub fn is_expanded(&self) -> bool
pub fn is_expanded(&self) -> bool
Check if this task has been expanded into subtasks
Sourcepub fn validate_id(id: &str) -> Result<(), String>
pub fn validate_id(id: &str) -> Result<(), String>
Validate task ID - must contain only alphanumeric characters, hyphens, underscores, colons (for namespacing), and dots (for subtask IDs)
Sourcepub fn validate_title(title: &str) -> Result<(), String>
pub fn validate_title(title: &str) -> Result<(), String>
Validate title - must not be empty and within length limit
Sourcepub fn validate_description(description: &str) -> Result<(), String>
pub fn validate_description(description: &str) -> Result<(), String>
Validate description - within length limit
Sourcepub fn validate_complexity(complexity: u32) -> Result<(), String>
pub fn validate_complexity(complexity: u32) -> Result<(), String>
Validate complexity - must be a Fibonacci number
Sourcepub fn sanitize_text(text: &str) -> String
pub fn sanitize_text(text: &str) -> String
Sanitize text by removing potentially dangerous HTML/script tags
pub fn set_status(&mut self, status: TaskStatus)
pub fn update(&mut self)
pub fn has_dependencies_met(&self, all_tasks: &[Task]) -> bool
Sourcepub fn has_dependencies_met_refs(&self, all_tasks: &[&Task]) -> bool
pub fn has_dependencies_met_refs(&self, all_tasks: &[&Task]) -> bool
Check if all dependencies are met, searching across provided task references Supports cross-tag dependencies when passed tasks from all phases
Sourcepub fn needs_expansion(&self) -> bool
pub fn needs_expansion(&self) -> bool
Returns whether this task should be expanded into subtasks All tasks with complexity >= 3 can benefit from expansion Subtasks and already-expanded tasks don’t need expansion
Sourcepub fn recommended_subtasks(&self) -> usize
pub fn recommended_subtasks(&self) -> usize
Returns the recommended number of subtasks based on complexity Complexity 1-2: 2 subtasks Complexity 3: 2-3 subtasks Complexity 5: 3-4 subtasks Complexity 8: 4-5 subtasks Complexity 13: 5-6 subtasks Complexity 21+: 6-8 subtasks
Sourcepub fn recommended_subtasks_for_complexity(complexity: u32) -> usize
pub fn recommended_subtasks_for_complexity(complexity: u32) -> usize
Static version for use when we only have complexity value