pub struct Note {
pub id: String,
pub content: String,
pub category: NoteCategory,
pub created_at: DateTime<Utc>,
}
Expand description
Represents a note in a specification for capturing important information.
A Note
captures important information, decisions, observations, or questions
that arise during the development of a specification. Notes are categorized
to help organize and filter information effectively.
§Use Cases
- Document implementation decisions and rationale
- Record questions and uncertainties for later resolution
- Track bugs and issues discovered during development
- Capture ideas for future enhancements
- Store important technical details and observations
§Fields
id
- Unique identifier for the notecontent
- The note content (supports Markdown formatting)category
- Type of note for organization and filteringcreated_at
- Timestamp when the note was created
§Examples
use project_manager_mcp::models::task::{Note, NoteCategory};
use chrono::Utc;
// Implementation note with code example
let impl_note = Note {
id: "note_auth_impl".to_string(),
content: "## JWT Implementation\n\nUsing the `jsonwebtoken` crate for JWT handling:\n\n```rust\nuse jsonwebtoken::{encode, decode, Header, Validation};\n\nlet token = encode(&Header::default(), &claims, &encoding_key)?;\n```\n\n**Note**: Remember to set appropriate expiration times.".to_string(),
category: NoteCategory::Implementation,
created_at: Utc::now(),
};
// Decision note
let decision_note = Note {
id: "note_db_choice".to_string(),
content: "Chose PostgreSQL over MongoDB for ACID compliance and complex queries".to_string(),
category: NoteCategory::Decision,
created_at: Utc::now(),
};
// Question note
let question_note = Note {
id: "note_scaling_question".to_string(),
content: "Should we implement horizontal scaling now or wait for user growth?".to_string(),
category: NoteCategory::Question,
created_at: Utc::now(),
};
// Bug report note
let bug_note = Note {
id: "note_session_bug".to_string(),
content: "Session tokens not being invalidated on logout - security risk!".to_string(),
category: NoteCategory::Bug,
created_at: Utc::now(),
};
Fields§
§id: String
Unique identifier for the note
content: String
The note content (supports Markdown formatting)
category: NoteCategory
Type of note for organization and filtering
created_at: DateTime<Utc>
Timestamp when the note was created
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Note
impl<'de> Deserialize<'de> for Note
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 Note
impl RefUnwindSafe for Note
impl Send for Note
impl Sync for Note
impl Unpin for Note
impl UnwindSafe for Note
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