39 breaking releases

new 0.45.0 May 13, 2024
0.43.0 Apr 2, 2024
0.42.0 Mar 18, 2024
0.35.2 Dec 21, 2023
0.7.2 Oct 28, 2022

#1 in #persist

Download history 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 201/week @ 2024-04-22 35/week @ 2024-04-29 137/week @ 2024-05-06

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

Apache-2.0

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