pub fn write_json<T>(path: &Path, prefix: &str, value: &T) -> Result<()>Expand description
Replaces path with value as pretty-printed JSON and one trailing
newline, atomically and durably.
The staging file lands beside path under prefix; see
create_staging_file for what a prefix may hold. path is left as it
was unless the whole value serialized and reached disk.
ยงErrors
std::io::ErrorKind::InvalidInputifprefixholds/or\.std::io::Errorcarrying aserde_json::Errorifvaluewould not serialize, or reporting a failed stage, write,fsyncor rename.