Skip to main content

save_autosave

Function save_autosave 

Source
fn save_autosave(
    pack: &mut Pack,
    folder: &Path,
    game: &GameInfo,
    disable_uuid_regeneration: bool,
    autosave_amount: usize,
) -> Result<()>
Expand description

Saves a pack as a new autosave in a folder, removing the oldest autosaves over the amount to keep.

§Arguments

  • pack - Copy of the pack to save.
  • folder - Folder with the autosaves of the pack.
  • game - Game the pack is for.
  • disable_uuid_regeneration - If tables keep their GUID when encoded.
  • autosave_amount - Amount of autosaves to keep.

§Errors

If the folder can’t be created, or the pack can’t be saved.