45 breaking releases
new 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 |
#859 in Encoding
252 downloads per month
Used in 2 crates
(via chamber-core)
30KB
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
~7–13MB
~151K SLoC