pub fn write_snapshot( path: &Path, state: &State, generation: u64, ) -> Result<(), DbError>
Write a complete database snapshot atomically.