task

The tasks table: units of work within a project.

Model is one row. New, Patch and Filter carry the input of a create, an update and a list.

struct Model

source

pub struct Model

A unit of work within a project.

Field Type Description
assigned_to Option<Id> Author the task is assigned to, if any.
created_at DateTime<Utc> When the task was first created.
description String Longer-form description of the work required.
id Id Stable identifier assigned at creation.
metadata Value Free-form JSON object for user-defined metadata.
priority Option<u8> Optional priority score; lower numbers rank first.
project_id Id Project this task belongs to.
resolved_at Option<DateTime<Utc>> When the task entered a terminal status, or None if still open.
status TaskStatus Current lifecycle status.
title String Short human-readable title.
updated_at DateTime<Utc> When the task was last modified.

Implements Clone, Debug, Deserialize<'de>, Eq, PartialEq, Serialize, TryFrom<Row>.

Model::priority

source

pub fn priority(&self) -> Option<u8>

Optional priority score; lower numbers rank first.

Parameter Type Description
returns Option<u8>

Model::status

source

pub fn status(&self) -> TaskStatus

Current lifecycle status.

Parameter Type Description
returns TaskStatus

Model::assigned_to

source

pub fn assigned_to(&self) -> &Option<Id>

Author the task is assigned to, if any.

Parameter Type Description
returns &Option<Id>

Model::created_at

source

pub fn created_at(&self) -> &DateTime<Utc>

When the task was first created.

Parameter Type Description
returns &DateTime<Utc>

Model::description

source

pub fn description(&self) -> &String

Longer-form description of the work required.

Parameter Type Description
returns &String

Model::id

source

pub fn id(&self) -> &Id

Stable identifier assigned at creation.

Parameter Type Description
returns &Id

Model::metadata

source

pub fn metadata(&self) -> &Value

Free-form JSON object for user-defined metadata.

Parameter Type Description
returns &Value

Model::project_id

source

pub fn project_id(&self) -> &Id

Project this task belongs to.

Parameter Type Description
returns &Id

Model::resolved_at

source

pub fn resolved_at(&self) -> &Option<DateTime<Utc>>

When the task entered a terminal status, or None if still open.

Parameter Type Description
returns &Option<DateTime<Utc>>

Model::title

source

pub fn title(&self) -> &String

Short human-readable title.

Parameter Type Description
returns &String

Model::updated_at

source

pub fn updated_at(&self) -> &DateTime<Utc>

When the task was last modified.

Parameter Type Description
returns &DateTime<Utc>

struct New

source

pub struct New

Parameters for creating a new task.

Field Type Description
assigned_to Option<Id> Author the new task should be assigned to.
description String Longer-form description of the work required.
metadata Option<Value> Optional user-defined metadata merged into the new row.
priority Option<u8> Optional priority score; lower numbers rank first.
status Option<TaskStatus> Initial lifecycle status; defaults to TaskStatus::default when unset.
title String Short human-readable title.

Implements Clone, Debug, Default, Deserialize<'de>, Serialize.

struct Patch

source

pub struct Patch

Optional fields for updating an existing task.

Field Type Description
assigned_to Option<Option<Id>> Replacement assignee; Some(None) explicitly clears it.
description Option<String> Replacement description.
metadata Option<Value> Replacement metadata object; overwrites the stored value when set.
priority Option<Option<u8>> Replacement priority; Some(None) explicitly clears it.
status Option<TaskStatus> New lifecycle status; transitions to terminal states also set resolved_at.
title Option<String> Replacement title.

Implements Clone, Debug, Default, Deserialize<'de>, Serialize.

struct Filter

source

pub struct Filter

Criteria for filtering tasks.

Field Type Description
all bool Include tasks in every status, even terminal ones.
assigned_to Option<String> Restrict to tasks assigned to the author matching this name or id prefix.
status Option<TaskStatus> Restrict to tasks in this status.
tag Option<String> Restrict to tasks carrying this tag label.

Implements Clone, Debug, Default.

Filter::all

source

pub fn all() -> Self

Construct a filter that includes tasks in every status, including terminal ones.

Parameter Type Description
returns Self A filter with all set and every other criterion unset.