pub struct Comment {Show 14 fields
pub id: String,
pub comment_type: CommentType,
pub block_ref: String,
pub range: Option<TextRange>,
pub author: Collaborator,
pub created: DateTime<Utc>,
pub content: String,
pub resolved: bool,
pub resolved_by: Option<Collaborator>,
pub resolved_at: Option<DateTime<Utc>>,
pub replies: Vec<Comment>,
pub parent_id: Option<String>,
pub priority: Option<Priority>,
pub tags: Vec<String>,
}Expand description
A comment or annotation on document content.
Fields§
§id: StringUnique identifier.
comment_type: CommentTypeType of comment.
block_ref: StringReference to the block being commented on.
range: Option<TextRange>Text range within the block (if applicable).
Author of the comment.
created: DateTime<Utc>When the comment was created.
content: StringComment content.
resolved: boolWhether the comment has been resolved.
resolved_by: Option<Collaborator>Who resolved the comment.
resolved_at: Option<DateTime<Utc>>When the comment was resolved.
replies: Vec<Comment>Replies to this comment.
parent_id: Option<String>Parent comment ID (for nested replies).
priority: Option<Priority>Priority level.
Tags or labels.
Implementations§
Source§impl Comment
impl Comment
Sourcepub fn new(
id: impl Into<String>,
block_ref: impl Into<String>,
author: Collaborator,
content: impl Into<String>,
) -> Self
pub fn new( id: impl Into<String>, block_ref: impl Into<String>, author: Collaborator, content: impl Into<String>, ) -> Self
Create a new comment.
Sourcepub fn highlight(
id: impl Into<String>,
block_ref: impl Into<String>,
range: TextRange,
author: Collaborator,
color: HighlightColor,
) -> Self
pub fn highlight( id: impl Into<String>, block_ref: impl Into<String>, range: TextRange, author: Collaborator, color: HighlightColor, ) -> Self
Create a new highlight.
Sourcepub fn suggestion(
id: impl Into<String>,
block_ref: impl Into<String>,
range: TextRange,
author: Collaborator,
original: impl Into<String>,
suggested: impl Into<String>,
) -> Self
pub fn suggestion( id: impl Into<String>, block_ref: impl Into<String>, range: TextRange, author: Collaborator, original: impl Into<String>, suggested: impl Into<String>, ) -> Self
Create a new suggestion.
Sourcepub fn reaction(
id: impl Into<String>,
block_ref: impl Into<String>,
author: Collaborator,
emoji: impl Into<String>,
) -> Self
pub fn reaction( id: impl Into<String>, block_ref: impl Into<String>, author: Collaborator, emoji: impl Into<String>, ) -> Self
Create a reaction.
Sourcepub fn with_range(self, range: TextRange) -> Self
pub fn with_range(self, range: TextRange) -> Self
Set the text range.
Sourcepub fn with_priority(self, priority: Priority) -> Self
pub fn with_priority(self, priority: Priority) -> Self
Set priority.
Sourcepub fn resolve(&mut self, by: Collaborator)
pub fn resolve(&mut self, by: Collaborator)
Resolve the comment.
Sourcepub fn is_suggestion(&self) -> bool
pub fn is_suggestion(&self) -> bool
Check if this is a suggestion.
Sourcepub fn suggestion_status(&self) -> Option<SuggestionStatus>
pub fn suggestion_status(&self) -> Option<SuggestionStatus>
Get the suggestion status if this is a suggestion.
Sourcepub fn accept_suggestion(&mut self) -> bool
pub fn accept_suggestion(&mut self) -> bool
Accept a suggestion.
Returns true if the suggestion was accepted, false if this is not a suggestion.
Sourcepub fn reject_suggestion(&mut self) -> bool
pub fn reject_suggestion(&mut self) -> bool
Reject a suggestion.
Returns true if the suggestion was rejected, false if this is not a suggestion.