git_bug/entities/issue/data/comment.rs
1// git-bug-rs - A rust library for interfacing with git-bug repositories
2//
3// Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de>
4// SPDX-License-Identifier: GPL-3.0-or-later
5//
6// This file is part of git-bug-rs/git-gub.
7//
8// You should have received a copy of the License along with this program.
9// If not, see <https://www.gnu.org/licenses/agpl.txt>.
10
11//! Concrete type of an [`Issue's`][`super::super::Issue`] comment.
12
13use crate::{
14 entities::issue::issue_operation::File,
15 replica::entity::{id::combined_id::CombinedId, identity::IdentityStub, timestamp::TimeStamp},
16};
17
18#[derive(Debug)]
19/// The representation of a comment in an Issue
20pub struct Comment {
21 /// The Id of this Comment.
22 ///
23 /// This is the result of a combination with the
24 /// [`Issue`][`crate::entities::issue::Issue`] id and the id
25 /// of the [`Operation`][`crate::replica::entity::operation::Operation<Issue>`]
26 /// that created this comment.
27 /// You can use this to effectively search for a comment, because it's Id
28 /// tells you which Issue it is contained in.
29 pub combined_id: CombinedId,
30
31 /// The Author of this Comment.
32 pub author: IdentityStub,
33
34 /// The body of this Comment.
35 pub message: String,
36
37 /// Additional files that have been attached to this Comment.
38 pub files: Vec<File>,
39
40 /// When this Comment was created.
41 pub timestamp: TimeStamp,
42}