Skip to main content

combs_mesh/blocks/
todo.rs

1//! `tdo` — a task list with statuses and dependencies.
2
3use serde::{Deserialize, Serialize};
4
5/// Task list block.
6#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
7pub struct TodoBlock {
8    /// The tasks.
9    #[serde(default)]
10    pub items: Vec<TodoItem>,
11}
12
13/// A single task.
14#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
15pub struct TodoItem {
16    /// Stable task key (referenced by `depends_on`).
17    pub key: String,
18    /// Human-readable task text.
19    pub value: String,
20    /// Current status.
21    pub status: TodoStatus,
22    /// Keys of tasks that must complete first.
23    #[serde(default)]
24    pub depends_on: Vec<String>,
25}
26
27/// Task status.
28#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
29pub enum TodoStatus {
30    /// Not started.
31    Pending,
32    /// Being worked on.
33    InProgress,
34    /// Finished.
35    Done,
36    /// Cannot proceed.
37    Blocked,
38}