Skip to main content

save

Function save 

Source
pub fn save(path: &Path, ledger: &CrateSeqLedger) -> Result<(), Error>
Expand description

Serializes ledger to TOML and writes it to path atomically.

Writes to a .tmp sibling first, then renames to avoid partial writes. Removes the .tmp file if the rename fails.

ยงErrors

Returns Error::Serialize if serialization fails, or Error::Io if the write or rename fails.