flowscope-export 0.5.0

Database export for FlowScope analysis results
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use flowscope_core::AnalyzeResult;

use crate::ExportError;

pub fn export_json(result: &AnalyzeResult, compact: bool) -> Result<String, ExportError> {
    if compact {
        serde_json::to_string(result).map_err(|err| ExportError::Serialization(err.to_string()))
    } else {
        serde_json::to_string_pretty(result)
            .map_err(|err| ExportError::Serialization(err.to_string()))
    }
}