#storage #format #toml #save #loading #load-save #saving-and-loading #email #serialization

easy_storage

Provides a trait to easily save and load structs in JSON or TOML format

7 unstable releases (3 breaking)

Uses new Rust 2024

0.4.1 Sep 16, 2025
0.4.0 Aug 30, 2025
0.3.2 Aug 15, 2025
0.2.0 Aug 15, 2025
0.1.1 Aug 15, 2025

#2505 in Encoding

Download history 14/week @ 2026-03-18 1/week @ 2026-03-25

491 downloads per month
Used in 2 crates

MIT/Apache

9KB
109 lines

Storeable Crate

A Rust crate that provides a trait for easily saving and loading data structures to and from files in either JSON or TOML format.

Installation

Add the following to your Cargo.toml file:

[dependencies]
easy_storage = "0.3.*"

https://crates.io/crates/easy_storage

Example

use serde::{Deserialize, Serialize};
use easy_storage::Storeable;

#[derive(Debug, Serialize, Deserialize)]
struct User {
    name: String,
    email: String,
}

impl Storeable for User {}

fn main() {
    let user = User {
        name: "Alice".to_string(),
        email: "alice@alice.com".to_string(),
    };
    let save_path = std::env::current_dir().unwrap().join("test").join("user.toml");
    match user.save_by_extension(&save_path, true) {
        Ok(_) => println!("success."),
        Err(e) => println!("Error: {e}"),
    }

    match User::load_by_extension(save_path) {
        Ok(s) => println!("{s:?}"),
        Err(e) => println!("Error: {e}"),
    }
}

Dependencies

~0.8–1.7MB
~36K SLoC