Serialize to a `serde_json::Value`. Returns the full OCSF JSON object, or an error if serialization fails.
(&self)
| 10 | /// |
| 11 | /// Returns the full OCSF JSON object, or an error if serialization fails. |
| 12 | pub fn to_json(&self) -> Result<serde_json::Value, serde_json::Error> { |
| 13 | serde_json::to_value(self) |
| 14 | } |
| 15 | |
| 16 | /// Serialize as a single JSONL line (no pretty-printing, trailing newline). |
| 17 | pub fn to_json_line(&self) -> Result<String, serde_json::Error> { |
no outgoing calls