Skip to main content

kmp_plugin_api/application/dto/
evidence_fragment.rs

1use serde::{Deserialize, Serialize};
2
3/// Evidence crossing the kernel/plugin boundary.
4#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
5pub struct EvidenceFragment {
6    pub ref_id: String,
7    pub text: String,
8    #[serde(skip_serializing_if = "Option::is_none")]
9    pub source: Option<String>,
10}
11
12impl EvidenceFragment {
13    pub fn new(ref_id: impl Into<String>, text: impl Into<String>) -> Self {
14        Self {
15            ref_id: ref_id.into(),
16            text: text.into(),
17            source: None,
18        }
19    }
20}