project_workspace

The project_workspaces table: the working directories that belong to a project.

struct Model

source

pub struct Model

A workspace directory that belongs to a super::Project.

Workspaces represent distinct working directories within a project. Each workspace is tied to exactly one project via project_id and is uniquely constrained on the (path, project_id) pair.

Field Type Description
created_at DateTime<Utc> When the workspace was first registered.
id Id Stable identifier assigned at creation.
path PathBuf Absolute path to the workspace directory.
project_id Id Project this workspace belongs to.
updated_at DateTime<Utc> When the workspace record was last modified.

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

Model::created_at

source

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

When the workspace was first registered.

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::path

source

pub fn path(&self) -> &PathBuf

Absolute path to the workspace directory.

Parameter Type Description
returns &PathBuf

Model::project_id

source

pub fn project_id(&self) -> &Id

Project this workspace belongs to.

Parameter Type Description
returns &Id

Model::updated_at

source

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

When the workspace record was last modified.

Parameter Type Description
returns &DateTime<Utc>

Model::new

source

pub fn new(path: PathBuf, project_id: Id) -> Self

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

Parameter Type Description
path PathBuf the workspace directory
project_id Id the project that the workspace belongs to
returns Self The workspace, not yet saved.