project

Per-entity sync adapter for the singleton project.yaml file.

Unlike the other entity adapters, there is exactly one project per .gest/ directory: it is the project that owns the gest_dir. Only fields that should travel with the repository (id, created_at, updated_at) are synced; the local checkout’s root path stays out of the file because it varies per collaborator.

struct ProjectFile

source

struct ProjectFile

On-disk wrapper for .gest/project.yaml.

Field declaration order is the on-disk order. deleted_at is first so it is immediately visible in diffs when a project is tombstoned.

Field Type Description
archived_at Option<DateTime<Utc>> When the project was soft-archived; absent for active projects.
deleted_at Option<DateTime<Utc>> Tombstone instant; absent for live projects.
id Id Stable project identifier shared across collaborators.
created_at DateTime<Utc> When this project was first created.
updated_at DateTime<Utc> When this project’s metadata was last modified.

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

fn read_all

source

pub async fn read_all(conn: &Connection, project_id: &Id, gest_dir: &Path) -> Result<(), Error>

Import the project from .gest/project.yaml into SQLite.

If the file is absent, this is a no-op (the project row already exists in SQLite or will be created by another path). If the file carries a tombstone the corresponding project row is hard-deleted.

Parameter Type Description
conn &Connection the open database connection
project_id &Id unused: the project id comes from the file
gest_dir &Path the project’s .gest/ directory; its parent is the root of a newly inserted row
returns Result<(), Error> () when the file is absent or has been applied, or the first read, parse or database error.

fn write_all

source

pub async fn write_all(conn: &Connection, project_id: &Id, gest_dir: &Path) -> Result<(), Error>

Export the project row to .gest/project.yaml.

Writes nothing when no row has the id project_id.

Parameter Type Description
conn &Connection the open database connection
project_id &Id the project to export; its sync_digests cache records the write
gest_dir &Path the project’s .gest/ directory
returns Result<(), Error> () when the file is written, unchanged or there is no row, or the first database, parse or I/O error.