43 breaking releases
0.49.0 | Nov 12, 2024 |
---|---|
0.47.0 | Jul 23, 2024 |
0.42.0 | Mar 18, 2024 |
0.35.2 | Dec 21, 2023 |
0.7.2 | Oct 28, 2022 |
#912 in Encoding
130 downloads per month
Used in 2 crates
(via chamber-core)
29KB
545 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 thePersistInstance
list()
: returns a vector of strings containing all the keys associated with aPersistInstance
load()
: loads the contents of thePersistInstance
new()
: constructs a newPersistInstance
along with its associated storage foldersave()
: saves a key-value pair into thePersistInstance
remove()
: deletes a key from thePersistInstance
An example using the Rocket framework can be found on GitHub
Dependencies
~6–12MB
~155K SLoC