git-bug 0.2.4

A rust library for interfacing with git-bug repositories
Documentation
// git-bug-rs - A rust library for interfacing with git-bug repositories
//
// Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de>
// SPDX-License-Identifier: GPL-3.0-or-later
//
// This file is part of git-bug-rs/git-gub.
//
// You should have received a copy of the License along with this program.
// If not, see <https://www.gnu.org/licenses/agpl.txt>.

//! Concrete type of an [`Issue's`][`super::super::Issue`] comment.

use crate::{
    entities::issue::issue_operation::File,
    replica::entity::{id::combined_id::CombinedId, identity::IdentityStub, timestamp::TimeStamp},
};

#[derive(Debug)]
/// The representation of a comment in an Issue
pub struct Comment {
    /// The Id of this Comment.
    ///
    /// This is the result of a combination with the
    /// [`Issue`][`crate::entities::issue::Issue`] id and the id
    /// of the [`Operation`][`crate::replica::entity::operation::Operation<Issue>`]
    /// that created this comment.
    /// You can use this to effectively search for a comment, because it's Id
    /// tells you which Issue it is contained in.
    pub combined_id: CombinedId,

    /// The Author of this Comment.
    pub author: IdentityStub,

    /// The body of this Comment.
    pub message: String,

    /// Additional files that have been attached to this Comment.
    pub files: Vec<File>,

    /// When this Comment was created.
    pub timestamp: TimeStamp,
}