pub fn write_journal_record(
directory: &Path,
filename: &str,
text: &str,
sync: RecordSync,
) -> Result<(), TransactionStop>Expand description
What:
Write one journal record exclusively and whole, then sync as sync says.
Why:
A state file is never rewritten, so a crash leaves the newest complete state readable; the level says what a
power loss may leave of this record.
In TS you’d write (pseudocode):
await writeJournalRecord({ directory, filename, record, sync });