| Crates.io | shuttle-persist |
| lib.rs | shuttle-persist |
| version | 0.51.0 |
| created_at | 2022-10-13 13:23:07.482287+00 |
| updated_at | 2025-01-10 10:19:19.158606+00 |
| description | Plugin for persist objects |
| homepage | |
| repository | https://github.com/shuttle-hq/shuttle |
| max_upload_size | |
| id | 687172 |
| size | 9,864 |
This plugin allows persisting struct that implement serde::Serialize and loading them again using serde::Deserialize.
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 PersistInstancelist(): returns a vector of strings containing all the keys associated with a PersistInstanceload(): loads the contents of the PersistInstancenew(): constructs a new PersistInstance along with its associated storage foldersave(): saves a key-value pair into the PersistInstanceremove(): deletes a key from the PersistInstanceAn example using the Rocket framework can be found on GitHub