project

The projects table: each repository or directory root that gest tracks.

struct Model

source

pub struct Model

A project represents a tracked repository or directory root.

Each project is uniquely identified by its root path and is assigned a stable Id at creation time.

Field Type Description
archived_at Option<DateTime<Utc>> When the project was soft-archived, or None if it is active.
created_at DateTime<Utc> When the project was first registered.
id Id Stable identifier shared with collaborators via synced .gest/project.yaml.
root PathBuf Absolute path to the local checkout root.
updated_at DateTime<Utc> When the project record 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 project was soft-archived, or None if it is active.

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

Model::created_at

source

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

When the project was first registered.

Parameter Type Description
returns &DateTime<Utc>

Model::id

source

pub fn id(&self) -> &Id

Stable identifier shared with collaborators via synced .gest/project.yaml.

Parameter Type Description
returns &Id

Model::root

source

pub fn root(&self) -> &PathBuf

Absolute path to the local checkout root.

Parameter Type Description
returns &PathBuf

Model::updated_at

source

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

When the project record was last modified.

Parameter Type Description
returns &DateTime<Utc>

Model::from_synced_parts

source

pub fn from_synced_parts(
    id: Id,
    root: PathBuf,
    archived_at: Option<DateTime<Utc>>,
    created_at: DateTime<Utc>,
    updated_at: DateTime<Utc>,
) -> Self

Reconstruct a project from a synced .gest/project.yaml file.

The id and timestamps come from the synced file (so collaborators share a stable identity), while root is the local checkout path.

Parameter Type Description
id Id the id from the synced file
root PathBuf the local checkout path
archived_at Option<DateTime<Utc>> when the project was archived, or None if it is active
created_at DateTime<Utc> when the project was first registered
updated_at DateTime<Utc> when the project record last changed
returns Self The project, built from these parts with no checks.

Model::new

source

pub fn new(root: PathBuf) -> Self

Create a new project with a fresh Id and timestamps set to now.

Parameter Type Description
root PathBuf the path of the project root
returns Self The project, active (not archived) and not yet saved.