MCPcopy Create free account
hub / github.com/SeaQL/FireDBG.for.Rust / to_json_file

Function to_json_file

parser/src/serde.rs:18–28  ·  view source on GitHub ↗
(path: &str, json: &S)

Source from the content-addressed store, hash-verified

16}
17
18pub async fn to_json_file<S>(path: &str, json: &S) -> Result<()>
19where
20 S: serde::Serialize,
21{
22 let mut file_sink = create_file_sink(path)
23 .await
24 .context("Fail to create file sink")?;
25 serde_json::to_writer_pretty(file_sink.as_writer(), json).context("Fail to write JSON")?;
26 file_sink.flush(1).await.context("Fail to flush")?;
27 Ok(())
28}
29
30async fn create_file_sink<T>(path: T) -> Result<sea_streamer_file::FileSink>
31where

Callers 3

cache_workspaceFunction · 0.85
list_targetFunction · 0.85
run_workspace_parsingFunction · 0.85

Calls 1

create_file_sinkFunction · 0.85

Tested by 1

run_workspace_parsingFunction · 0.68