pub struct Post {
pub id: String,
pub author: String,
pub body: String,
pub labels: Vec<String>,
pub attachments: Vec<Attachment>,
pub refs: Vec<String>,
pub created: DateTime<Utc>,
pub edited: Option<DateTime<Utc>>,
pub next_reply: u64,
pub replies: Vec<Post>,
}Expand description
A single forum post: the root of a thread, or a reply at any depth. IDs are
dotted and self-describing (F-1, F-1.1, F-1.1.2), so the tree is legible
from the ID alone and a subtree is “every ID under this prefix”.
Fields§
§id: StringDotted post ID (F-1, F-1.2, F-1.2.1).
Author identity (git Name <email> or agent ID), same pool as tickets.
body: StringMessage body (Markdown allowed).
labels: Vec<String>Labels, drawn from the same board label pool as tickets.
attachments: Vec<Attachment>Attached media/files (same storage as ticket attachments).
refs: Vec<String>Free-form references (ticket IDs like T-3, other post IDs, or URLs).
created: DateTime<Utc>When the post was created.
edited: Option<DateTime<Utc>>When the post was last edited, if ever.
next_reply: u64Next child index; the next reply gets <id>.<next_reply> (never reused).
replies: Vec<Post>Direct replies (each may have its own replies, forming the tree).
Implementations§
Source§impl Post
impl Post
Sourcepub fn new(
id: impl Into<String>,
author: impl Into<String>,
body: impl Into<String>,
now: DateTime<Utc>,
) -> Self
pub fn new( id: impl Into<String>, author: impl Into<String>, body: impl Into<String>, now: DateTime<Utc>, ) -> Self
Create a fresh post with no replies.
Sourcepub fn find(&self, id: &str) -> Option<&Post>
pub fn find(&self, id: &str) -> Option<&Post>
Find a post by ID anywhere in this subtree (including self).
Sourcepub fn find_mut(&mut self, id: &str) -> Option<&mut Post>
pub fn find_mut(&mut self, id: &str) -> Option<&mut Post>
Find a post by ID anywhere in this subtree (mutable).
Sourcepub fn remove_child(&mut self, id: &str) -> bool
pub fn remove_child(&mut self, id: &str) -> bool
Remove the direct child with id (not recursive). Returns true if removed.