Artifacts Crate
A crate for managing shared read/write access to data stored in a JSON file. The Artifact struct supports initializing the data from a JSON file, getting a read lock on the data, updating the data, and watching for changes on the file to automatically reload the data at a specified interval.
Usage
- Add the following to your
Cargo.tomlfile:
[]
= "0.1.0"
- Define your struct and make sure it implements DeserializeOwned:
- Initialize the Artifact with your struct:
pub static EXAMPLE_LIST: = new;
- In your main function or another appropriate place, initialize the Artifact data and spawn the watch task:
async
For more details, please refer to the crate documentation or read the comments in the source code.
License
This project is licensed under the MIT License.