45 breaking releases
| 0.51.0 | Jan 10, 2025 |
|---|---|
| 0.49.0 | Nov 12, 2024 |
| 0.47.0 | Jul 23, 2024 |
| 0.42.0 | Mar 18, 2024 |
| 0.7.2 | Oct 28, 2022 |
#19 in #shuttle-service
Used in 2 crates
(via chamber-core)
18KB
268 lines
Shuttle Persist
This plugin allows persisting struct that implement serde::Serialize and loading them again using serde::Deserialize.
Usage
Add shuttle-persist to the dependencies for your service. You can get this resource using the shuttle-persist::Persist attribute to get a PersistInstance. Objects can now be managed with the following six methods:
clear(): removes the keys within thePersistInstancelist(): returns a vector of strings containing all the keys associated with aPersistInstanceload(): loads the contents of thePersistInstancenew(): constructs a newPersistInstancealong with its associated storage foldersave(): saves a key-value pair into thePersistInstanceremove(): deletes a key from thePersistInstance
An example using the Rocket framework can be found on GitHub
Dependencies
~6.5–8.5MB
~147K SLoC