#[non_exhaustive]pub struct Task {Show 16 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 activity: Vec<Activity>,
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 (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.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.
activity: Vec<Activity>Every change to the title, tags, related entries or description, 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 log(&mut self, at: DateTime<Local>, by: Author, change: Changed)
pub fn log(&mut self, at: DateTime<Local>, by: Author, change: Changed)
Records change, made by someone at a time, in the activity, in time order (another computer’s clock
may be behind). The latest change, when the same author made it in the same second to the same thing, takes it
in (the app saves a form’s related entries one at a time), and one that ends up changing nothing goes; any
other change between them keeps them apart, so the activity still says what came first.
Sourcepub fn set_title(
&mut self,
title: String,
at: DateTime<Local>,
by: Author,
) -> bool
pub fn set_title( &mut self, title: String, at: DateTime<Local>, by: Author, ) -> bool
Gives the entry title, made by someone at a time, and logs it; returns whether it changed.
Gives the entry tags, made by someone at a time, and logs which it got and lost; returns whether they
changed, the order included.
Sourcepub fn set_description(
&mut self,
description: String,
at: DateTime<Local>,
by: Author,
) -> bool
pub fn set_description( &mut self, description: String, at: DateTime<Local>, by: Author, ) -> bool
Gives the entry description, made by someone at a time, and logs that it changed; returns whether it did.
Sourcepub fn relate(
&mut self,
at: DateTime<Local>,
by: Author,
added: &[String],
removed: &[String],
)
pub fn relate( &mut self, at: DateTime<Local>, by: Author, added: &[String], removed: &[String], )
Logs that the entry was related to the entries added names and unrelated from those removed names (see
Changed::Related), by someone at a time. Whichever side keeps the link, both entries log it.
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, as does a verdict on the decision it asked about. Starting the task after either means it was picked up, so it’s neither once the task is parked again for another reason.
Sourcepub fn thread(&self) -> Vec<ThreadItem<'_>>
pub fn thread(&self) -> Vec<ThreadItem<'_>>
The comments and the activity together, oldest first, each in its own order. A change and a comment in the same second go change first: the app’s Save and tell writes the comment that tells of a change after it.