pub struct Task {Show 21 fields
pub id: String,
pub title: String,
pub task_type: TaskType,
pub priority: u8,
pub status: Status,
pub parent: Option<String>,
pub depends_on: Vec<String>,
pub description: String,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
pub closed_at: Option<DateTime<Utc>>,
pub claimed_by: Option<String>,
pub branch: Option<String>,
pub tags: Vec<String>,
pub notes: Vec<Note>,
pub links: Vec<Link>,
pub closed_children: Vec<ArchivedChild>,
pub external: BTreeMap<String, Value>,
pub synced_at: BTreeMap<String, DateTime<Utc>>,
pub delivered_in: Option<String>,
pub extra: BTreeMap<String, Value>,
}Fields§
§id: String§title: String§task_type: TaskType§priority: u8§status: Status§parent: Option<String>§depends_on: Vec<String>§description: String§created_at: DateTime<Utc>§updated_at: DateTime<Utc>§closed_at: Option<DateTime<Utc>>§claimed_by: Option<String>§branch: Option<String>§notes: Vec<Note>§links: Vec<Link>§closed_children: Vec<ArchivedChild>§external: BTreeMap<String, Value>§synced_at: BTreeMap<String, DateTime<Utc>>Per-plugin timestamp of the last time balls applied a push or
sync response for this task from the named plugin. Plugins
compare their remote’s updated_at against this value for
bidirectional conflict resolution without maintaining a
side-cache. Written by balls, sent back on every push/sync.
Missing keys mean “never synced by that plugin”.
delivered_in: Option<String>Performance hint: SHA of the squash-merge on main that
delivered this task. Ground truth is the [id] tag embedded
in the commit message — see crate::delivery.
extra: BTreeMap<String, Value>Forward-compat passthrough. Any top-level JSON field that the
current struct doesn’t name lands here on deserialize and
round-trips back out on save. Lets an older bl load a task
file written by a future version without silently dropping
new first-party fields. external already exists for plugin
data; extra is the catch-all for everything else.
Implementations§
Source§impl Task
impl Task
pub fn generate_id(title: &str, ts: DateTime<Utc>, id_length: usize) -> String
pub fn new(opts: NewTaskOpts, id: String) -> Self
pub fn touch(&mut self)
Sourcepub fn append_note(&mut self, author: &str, text: &str)
pub fn append_note(&mut self, author: &str, text: &str)
In-memory note append. Does not persist. For on-disk persistence,
use task_io::append_note_to, which writes to the append-only
sibling file and is safe for concurrent writers.
Source§impl Task
impl Task
Sourcepub fn load(path: &Path) -> Result<Self>
pub fn load(path: &Path) -> Result<Self>
Load a task from path. Notes live in a sibling file; load handles
both the new layout (notes in sibling) and legacy task files whose
notes array is embedded in the JSON. Either way, the returned
Task.notes is the union of both sources.
Sourcepub fn save(&self, path: &Path) -> Result<()>
pub fn save(&self, path: &Path) -> Result<()>
Persist a task to path in the text-mergeable format. Never writes
the notes sidecar content; use append_note_to for that. Does
ensure the notes sidecar exists as an empty file on first save, so
that concurrent first-append operations on divergent branches see
the file in the merge base and use git’s union merge driver
instead of racing on add/add.