38 breaking releases

new 0.44.0 Apr 23, 2024
0.42.0 Mar 18, 2024
0.35.2 Dec 21, 2023
0.34.1 Nov 29, 2023
0.7.2 Oct 28, 2022

#2 in #persist

Download history 23/week @ 2024-01-01 48/week @ 2024-01-08 25/week @ 2024-01-15 78/week @ 2024-01-22 23/week @ 2024-01-29 9/week @ 2024-02-05 157/week @ 2024-02-12 63/week @ 2024-02-19 152/week @ 2024-02-26 403/week @ 2024-03-04 1032/week @ 2024-03-11 152/week @ 2024-03-18 5/week @ 2024-03-25 269/week @ 2024-04-01 42/week @ 2024-04-08 66/week @ 2024-04-15

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

Apache-2.0

29KB
535 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

~7.5MB
~161K SLoC