shuttle-persist

Crates.ioshuttle-persist
lib.rsshuttle-persist
version0.43.0
sourcesrc
created_at2022-10-13 13:23:07.482287
updated_at2024-04-02 12:27:28.286163
descriptionPlugin for persist objects
homepage
repository
max_upload_size
id687172
Jocelyn Boullier (Kazy)

documentation

README

# 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](https://github.com/shuttle-hq/shuttle-examples/tree/main/rocket/persist)
Commit count: 0

cargo fmt