jiden

Crates.iojiden
lib.rsjiden
created_at2024-03-21 17:33:08.610909
updated_at2024-03-21 22:22:38.126022
downloads0
descriptionSave and retrive state and progress through a system file
homepage
repositoryhttps://gitlab.com/adhami3310/jiden
max_upload_size
id1181895
Khaleel Al-Adhami

documentation

README

# Jiden ![Crates.io Version](https://img.shields.io/crates/v/jiden) Save and retrive state and progress through a system file ## Examples ### State Save ```rust let state_saver = StateSaver::new("state.txt"); state_saver.save(&1); assert_eq!(state_saver.state(), Some(1)); ``` After restarting the application: ```rust let state_saver = StateSaver::new("state.txt"); assert_eq!(state_saver.state(), Some(1)); ``` ### Progress Save ```rs let state_saver = ProgressSaver::new("state.txt"); state_saver.save(0, 1); assert_eq!(HashMap::from([(0, 1)]), progress_saver.state()); ``` After restarting the application: ```rs let state_saver = ProgressSaver::new("state.txt"); assert_eq!(HashMap::from([(0, 1)]), progress_saver.state()); ```
Commit count: 7

cargo fmt