pub struct Task {Show 15 fields
pub id: u32,
pub kind: Kind,
pub title: String,
pub tags: Vec<String>,
pub links: Vec<u32>,
pub repo_links: Vec<RepoLink>,
pub status: Status,
pub decision: DecisionState,
pub created: DateTime<Local>,
pub description: String,
pub comments: Vec<Comment>,
pub history: Vec<StatusChange>,
pub sessions: Vec<Session>,
pub path: Option<PathBuf>,
pub unknown: Unknown,
}Expand description
An entry: a task, note or decision. What it is, how it’s tagged and linked, and for tasks, where it stands and how it got there.
Fields§
§id: u32Unique number across all kinds, also the start of the file name.
kind: KindTask, note or decision.
title: StringOne-line title.
Lowercase, without the leading #.
links: Vec<u32>Ids of related entries, in the order they were added. Deleting an entry removes the links to it.
repo_links: Vec<RepoLink>Related entries in the project’s other repositories, in the order they were added. Nothing checks them once written: the other repository may be elsewhere, or the entry deleted there since.
status: StatusWhere the task stands.
decision: DecisionStateDecisions only: whether it’s in force, proposed or rejected.
created: DateTime<Local>When the task was created.
description: StringFree text describing the task.
comments: Vec<Comment>Oldest first.
history: Vec<StatusChange>Every status change, oldest first.
sessions: Vec<Session>Tracked work, oldest first; only the last one can be open, and only while the task is doing.
path: Option<PathBuf>File this task was loaded from / saved to.
unknown: UnknownWhat the file holds that this version doesn’t understand, written back as it was.
Implementations§
Source§impl Task
impl Task
Sourcepub fn to_markdown(&self) -> String
pub fn to_markdown(&self) -> String
The task as a markdown file (see the format at the top of this module).
Source§impl Task
impl Task
Sourcepub fn set_status(
&mut self,
status: Status,
now: DateTime<Local>,
by: Author,
) -> bool
pub fn set_status( &mut self, status: Status, now: DateTime<Local>, by: Author, ) -> bool
Moves the task to status and records the change, made by someone. Returns false if it already
was there. Leaving doing closes the open session, so a clock never keeps running on a task that
isn’t being worked on.
Sourcepub fn is_running(&self) -> bool
pub fn is_running(&self) -> bool
Whether the last session is still open.
Sourcepub fn running_for(&self, now: DateTime<Local>) -> Option<Duration>
pub fn running_for(&self, now: DateTime<Local>) -> Option<Duration>
How long the open session has been running, if any.
Sourcepub fn start_session(&mut self, now: DateTime<Local>)
pub fn start_session(&mut self, now: DateTime<Local>)
Opens a session now, unless one is already running. The caller moves the task to doing.
Sourcepub fn stop_session(&mut self, now: DateTime<Local>)
pub fn stop_session(&mut self, now: DateTime<Local>)
Closes the open session, if any.
Sourcepub fn time_between(
&self,
from: DateTime<Local>,
to: DateTime<Local>,
now: DateTime<Local>,
) -> Duration
pub fn time_between( &self, from: DateTime<Local>, to: DateTime<Local>, now: DateTime<Local>, ) -> Duration
Time tracked inside [from, to): sessions are clipped to the range. For several tasks, see worked.
Sourcepub fn started_by(&self) -> Author
pub fn started_by(&self) -> Author
Who last moved the task to doing: a person or an agent. A task in doing with no such change (from
an older version, or edited by hand) counts as a person’s.
Sourcepub fn status_since(&self) -> DateTime<Local>
pub fn status_since(&self) -> DateTime<Local>
When the status last changed (or the task was created, if never); used for sorting.
Sourcepub fn asked(&self) -> Option<Asked<'_>>
pub fn asked(&self) -> Option<Asked<'_>>
The question this parked task waits on, or its answer. A question is the latest comment marked as one; a person’s comment after it answers it. Starting the task after either means it was picked up, so it’s neither once the task is parked again for another reason.