artifact

The artifacts table: a project’s documents, such as specs and ADRs.

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 persistent document (spec, ADR, design doc, etc.) within a project.

Field Type Description
archived_at Option<DateTime<Utc>> When the artifact was archived, or None if still active.
body String Markdown body; skipped during serialization because it is stored and synced separately.
created_at DateTime<Utc> When the artifact was first inserted.
id Id Stable identifier assigned at creation.
metadata Value Free-form JSON object for user-defined metadata.
project_id Id Project this artifact belongs to.
title String Short human-readable title.
updated_at DateTime<Utc> When the artifact was last modified.

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

Model::archived_at

source

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

When the artifact was archived, or None if still active.

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

Model::body

source

pub fn body(&self) -> &String

Markdown body; skipped during serialization because it is stored and synced separately.

Parameter Type Description
returns &String

Model::created_at

source

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

When the artifact was first inserted.

Parameter Type Description
returns &DateTime<Utc>

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 artifact belongs to.

Parameter Type Description
returns &Id

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 artifact was last modified.

Parameter Type Description
returns &DateTime<Utc>

Model::is_archived

source

pub fn is_archived(&self) -> bool

Whether this artifact is archived.

Parameter Type Description
returns bool true when archived_at is set.

struct New

source

pub struct New

Parameters for creating a new artifact.

Field Type Description
body String Markdown body content.
metadata Option<Value> Optional user-defined metadata merged into the new row.
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 artifact.

Field Type Description
body Option<String> Replacement markdown body.
metadata Option<Value> Replacement metadata object; overwrites the stored value when set.
title Option<String> Replacement title.

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

struct Filter

source

pub struct Filter

Criteria for filtering artifacts.

Field Type Description
all bool Include archived artifacts alongside active ones.
only_archived bool Restrict results to archived artifacts only.
tag Option<String> Restrict to artifacts carrying this tag label.

Implements Clone, Debug, Default.