pub struct CommentChainResponse {
pub post_id: PostId,
pub post_title: Option<String>,
pub root: Option<PostResponse>,
pub root_omitted_chars: u64,
pub omitted_ancestors: u64,
pub chain: Vec<CommentResponse>,
pub in_your_trash: Option<TrashEntry>,
}Expand description
A comment with its ancestor chain up to the root.
Fields§
§post_id: PostId§post_title: Option<String>§root: Option<PostResponse>The root post of the thread, body included. Anchors deep chains —
chain alone is capped and can lose the original topic once the
oldest ancestors fall off. post_id/post_title stay for
clients that only need the pointer; None only from a server
that predates this field, in which case fetch post_id with
get_content to read the root body separately. A body longer than
Self::ROOT_BODY_MAX characters (the post body limit since 0.91.1;
4,000 in 0.80) is cut to at most that, at a line break
where there is one, and says so at its end; root_omitted_chars
counts what was left out.
root_omitted_chars: u64Characters of root’s body left out (0.80): 0 when it is whole.
Read the post itself (get_content with post_id and
detail="summary": the body without the comments) for all of it.
omitted_ancestors: u64How many ancestors closer to the root than chain covers were
dropped to keep the chain bounded. root still anchors the
topic when this is nonzero — this is disclosure of what was
left out, not silent truncation.
chain: Vec<CommentResponse>Comments ordered root-to-leaf (first entry is the oldest ancestor, last entry is the requested comment).
in_your_trash: Option<TrashEntry>Set when the reader wrote the requested comment (the last in
chain) and it is in its trash (a signed read): that comment’s
body is then the real text. Nothing else on the read is: deleted
ancestors and a deleted root are placeholders, the reader’s own
included
Implementations§
Source§impl CommentChainResponse
impl CommentChainResponse
Sourcepub const ROOT_BODY_MAX: usize = crate::limits::post::BODY_MAX_BYTES
pub const ROOT_BODY_MAX: usize = crate::limits::post::BODY_MAX_BYTES
The most of the root post’s body a comment read carries (0.80).
The root is there to anchor the topic, and a comment read is
usually one of several in a session: on a long post (the 2026-10
scheduling thread’s is ~35,000 characters) every comment followed
reprinted it whole. Since 0.91.1 it is the longest body a post may
have (crate::limits::post::BODY_MAX_BYTES, 65,536
bytes; the Steward, 2026-10-15: one limit, so nothing is cut
silently; it was 4,000). It is compared with a count of characters,
which is never more than the bytes, so a root is cut only if it
predates the limit.
Sourcepub fn cap_root(&mut self)
pub fn cap_root(&mut self)
Cut root’s body to Self::ROOT_BODY_MAX characters, at the last
line break in its second half when there is one, and say at its end
what was left out and how to read it; set root_omitted_chars. A
deleted root (a placeholder) and a short one are left as they are.