pub struct Specification {
pub id: String,
pub name: String,
pub description: String,
pub status: SpecStatus,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
pub content: String,
}
Expand description
Represents a project specification with detailed requirements and implementation details.
A Specification
captures the detailed requirements, design decisions, and implementation
plans for a specific feature or component of a project. Specifications are stored as
structured documents with markdown content and are tracked through various status states.
§ID Format
Specification IDs follow the format YYYYMMDD_snake_case_name
where:
YYYYMMDD
is the creation date (e.g., “20240115”)snake_case_name
describes the specification (e.g., “user_authentication”)- Example: “20240115_user_authentication”
§Fields
id
- Unique identifier in YYYYMMDD_name formatname
- Human-readable title for the specificationdescription
- Brief summary of what the specification coversstatus
- Current progress state (Draft, InProgress, Completed, OnHold)created_at
- Timestamp when the specification was createdupdated_at
- Timestamp of the last modificationcontent
- Full specification content in Markdown format
§Examples
use project_manager_mcp::models::specification::{Specification, SpecStatus};
use chrono::Utc;
// Create a new API specification
let api_spec = Specification {
id: "20240115_rest_api".to_string(),
name: "REST API Design".to_string(),
description: "RESTful API endpoints for user management".to_string(),
status: SpecStatus::Draft,
created_at: Utc::now(),
updated_at: Utc::now(),
content: "# REST API Specification\n\n## Overview\nThis specification defines the REST API endpoints for user management.\n\n## Endpoints\n\n### GET /users\n- Returns list of all users\n- Supports pagination via query parameters\n\n### POST /users\n- Creates a new user\n- Requires JSON body with user data\n\n## Authentication\nAll endpoints require JWT token in Authorization header.".to_string(),
};
// Create a database schema specification
let db_spec = Specification {
id: "20240116_database_schema".to_string(),
name: "Database Schema Design".to_string(),
description: "PostgreSQL schema for user and product data".to_string(),
status: SpecStatus::InProgress,
created_at: Utc::now(),
updated_at: Utc::now(),
content: "# Database Schema\n\n## User Table\n```sql\nCREATE TABLE users (\n id SERIAL PRIMARY KEY,\n email VARCHAR(255) UNIQUE NOT NULL,\n password_hash VARCHAR(255) NOT NULL,\n created_at TIMESTAMP DEFAULT NOW()\n);\n```".to_string(),
};
Fields§
§id: String
Unique identifier in YYYYMMDD_name format (e.g., “20240115_user_auth”)
name: String
Human-readable title for the specification
description: String
Brief summary of what the specification covers
status: SpecStatus
Current progress state of the specification
created_at: DateTime<Utc>
Timestamp when the specification was created
updated_at: DateTime<Utc>
Timestamp of the last modification
content: String
Full specification content in Markdown format
Trait Implementations§
Source§impl Clone for Specification
impl Clone for Specification
Source§fn clone(&self) -> Specification
fn clone(&self) -> Specification
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for Specification
impl Debug for Specification
Source§impl<'de> Deserialize<'de> for Specification
impl<'de> Deserialize<'de> for Specification
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Specification
impl RefUnwindSafe for Specification
impl Send for Specification
impl Sync for Specification
impl Unpin for Specification
impl UnwindSafe for Specification
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more