MCPcopy Create free account
hub / github.com/apache/datafusion / to_json

Method to_json

benchmarks/src/util/run.rs:170–175  ·  view source on GitHub ↗

Stringify data into formatted json

(&self)

Source from the content-addressed store, hash-verified

168
169 /// Stringify data into formatted json
170 pub fn to_json(&self) -> String {
171 let mut output = HashMap::<&str, Value>::new();
172 output.insert("context", serde_json::to_value(&self.context).unwrap());
173 output.insert("queries", serde_json::to_value(&self.queries).unwrap());
174 serde_json::to_string_pretty(&output).unwrap()
175 }
176
177 /// Write data as json into output path if it exists.
178 pub fn maybe_write_json(&self, maybe_path: Option<impl AsRef<Path>>) -> Result<()> {

Callers 1

maybe_write_jsonMethod · 0.80

Calls 2

newFunction · 0.85
insertMethod · 0.45

Tested by

no test coverage detected