socorro_cli/output/
json.rs1use crate::Result;
6use crate::models::bugs::BugsResponse;
7use crate::models::crash_pings::{CrashPingStackSummary, CrashPingsSummary};
8use crate::models::{CorrelationsResponse, ProcessedCrash, SearchResponse};
9
10pub fn format_bugs(response: &BugsResponse) -> Result<String> {
11 Ok(serde_json::to_string_pretty(response)?)
12}
13
14pub fn format_crash(crash: &ProcessedCrash) -> Result<String> {
15 Ok(serde_json::to_string_pretty(crash)?)
16}
17
18pub fn format_search(response: &SearchResponse) -> Result<String> {
19 Ok(serde_json::to_string_pretty(response)?)
20}
21
22pub fn format_correlations(response: &CorrelationsResponse) -> Result<String> {
23 Ok(serde_json::to_string_pretty(response)?)
24}
25
26pub fn format_crash_pings(summary: &CrashPingsSummary) -> Result<String> {
27 Ok(serde_json::to_string_pretty(summary)?)
28}
29
30pub fn format_crash_ping_stack(summary: &CrashPingStackSummary) -> Result<String> {
31 Ok(serde_json::to_string_pretty(summary)?)
32}