41 breaking releases

new 0.47.0 Jul 23, 2024
0.45.0 May 13, 2024
0.42.0 Mar 18, 2024
0.35.2 Dec 21, 2023
0.7.2 Oct 28, 2022

#5 in #persist

Download history 259/week @ 2024-03-31 52/week @ 2024-04-07 56/week @ 2024-04-14 204/week @ 2024-04-21 36/week @ 2024-04-28 112/week @ 2024-05-05 196/week @ 2024-05-12 55/week @ 2024-05-19 71/week @ 2024-05-26 69/week @ 2024-06-02 169/week @ 2024-06-09 45/week @ 2024-06-16 17/week @ 2024-06-23 6/week @ 2024-06-30 90/week @ 2024-07-07 24/week @ 2024-07-14

138 downloads per month
Used in 2 crates (via chamber-core)

Apache-2.0

30KB
557 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 the PersistInstance
  • list(): returns a vector of strings containing all the keys associated with a PersistInstance
  • load(): loads the contents of the PersistInstance
  • new(): constructs a new PersistInstance along with its associated storage folder
  • save(): saves a key-value pair into the PersistInstance
  • remove(): deletes a key from the PersistInstance

An example using the Rocket framework can be found on GitHub

Dependencies

~7MB
~150K SLoC