pub struct Report {Show 17 fields
pub xarf_version: String,
pub report_id: String,
pub timestamp: String,
pub reporter: Contact,
pub sender: Contact,
pub source_identifier: String,
pub category: Category,
pub type_: String,
pub source_port: Option<u16>,
pub evidence_source: Option<String>,
pub evidence: Option<Vec<Evidence>>,
pub confidence: Option<f64>,
pub tags: Option<Vec<String>>,
pub description: Option<String>,
pub legacy_version: Option<String>,
pub internal: Option<Map<String, Value>>,
pub extra: BTreeMap<String, Value>,
}Expand description
A XARF v4 report. Core spec fields are strongly typed; category-specific
fields live in Report::extra keyed by the JSON property name.
extra is sorted (it’s a BTreeMap) so re-serializations are
deterministic.
Fields§
§xarf_version: String§report_id: String§timestamp: String§reporter: Contact§sender: Contact§source_identifier: String§category: Category§type_: String§source_port: Option<u16>§evidence_source: Option<String>§evidence: Option<Vec<Evidence>>§confidence: Option<f64>§description: Option<String>§legacy_version: Option<String>§internal: Option<Map<String, Value>>Internal operational metadata. NEVER transmitted. Use
Report::strip_internal before emitting to another system.
extra: BTreeMap<String, Value>Category-specific and forward-compatible extra fields. Sorted for deterministic serialization.
Implementations§
Source§impl Report
impl Report
Sourcepub fn strip_internal(&mut self) -> Option<Map<String, Value>>
pub fn strip_internal(&mut self) -> Option<Map<String, Value>>
Remove the _internal block. Always do this before transmission.
Sourcepub fn extra(&self, key: &str) -> Option<&Value>
pub fn extra(&self, key: &str) -> Option<&Value>
Look up an extra (category-specific) field by name.
Sourcepub fn set_extra(
&mut self,
key: impl Into<String>,
value: Value,
) -> Option<Value>
pub fn set_extra( &mut self, key: impl Into<String>, value: Value, ) -> Option<Value>
Insert or replace an extra field. Returns the previous value.
Sourcepub fn to_json_value(&self) -> Value
pub fn to_json_value(&self) -> Value
Convert the report to a plain serde_json::Value (object). The result
has the core fields first followed by category extras, but ordering of
the extras within the object follows BTreeMap order — that is,
alphabetic.