Shuttle Persist

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 saved using and loaded again using PersistInstance.load().


This snippet shows a Shuttle rocket main function that uses the shuttle_persist::Persist attribute to provision and get access to a PersistInstance.
async fn rocket(
    #[shuttle_persist::Persist] persist: PersistInstance,
) -> ShuttleRocket {
    let state = MyState { persist };
    let rocket = rocket::build()
        .mount("/", routes![retrieve, add])


The full example can be found on GitHub