joydb 0.1.0

An in-memory embedded database with persistence and multiple adapters (JSON, CSV, etc). Acts like a minimalistic ORM with zero setup. Simple, lightweight, and perfect for prototypes, small apps, or experiments.
Documentation
1
2
3
4
5
6
7
8
9
10
11
use serde::{Deserialize, Serialize};
use std::fmt::Debug;

/// An identifiable model that can be stored in a database.
pub trait Model: Clone + Serialize + for<'de> Deserialize<'de> {
    type Id: Debug + Clone + Eq;

    fn id(&self) -> &Self::Id;

    fn model_name() -> &'static str;
}