task
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
pub struct ModelA 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
pub fn priority(&self) -> Option<u8>Optional priority score; lower numbers rank first.
| Parameter | Type | Description |
|---|---|---|
| returns | Option<u8> |
Model::status
pub fn status(&self) -> TaskStatusCurrent lifecycle status.
| Parameter | Type | Description |
|---|---|---|
| returns | TaskStatus |
Model::assigned_to
pub fn assigned_to(&self) -> &Option<Id>Author the task is assigned to, if any.
| Parameter | Type | Description |
|---|---|---|
| returns | &Option<Id> |
Model::created_at
pub fn created_at(&self) -> &DateTime<Utc>When the task was first created.
| Parameter | Type | Description |
|---|---|---|
| returns | &DateTime<Utc> |
Model::description
pub fn description(&self) -> &StringLonger-form description of the work required.
| Parameter | Type | Description |
|---|---|---|
| returns | &String |
Model::id
pub fn id(&self) -> &IdStable identifier assigned at creation.
| Parameter | Type | Description |
|---|---|---|
| returns | &Id |
Model::metadata
pub fn metadata(&self) -> &ValueFree-form JSON object for user-defined metadata.
| Parameter | Type | Description |
|---|---|---|
| returns | &Value |
Model::project_id
pub fn project_id(&self) -> &IdProject this task belongs to.
| Parameter | Type | Description |
|---|---|---|
| returns | &Id |
Model::resolved_at
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
pub fn title(&self) -> &StringShort human-readable title.
| Parameter | Type | Description |
|---|---|---|
| returns | &String |
Model::updated_at
pub fn updated_at(&self) -> &DateTime<Utc>When the task was last modified.
| Parameter | Type | Description |
|---|---|---|
| returns | &DateTime<Utc> |
struct New
pub struct NewParameters 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
pub struct PatchOptional 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
pub struct FilterCriteria 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
pub fn all() -> SelfConstruct 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. |