#entity #id #ulid #derive #identifier #web-apps

entity_id

Production-grade entity IDs for your web application

4 releases

0.0.4 Mar 26, 2023
0.0.3 Mar 26, 2023
0.0.2 Mar 26, 2023
0.0.1 Mar 26, 2023

#13 in #ulid

Download history 13/week @ 2024-04-04

54 downloads per month

MIT license

12KB
176 lines

entity_id

Crates.io Docs.rs Crates.io

Production-grade entity IDs for your web application.

Usage

use entity_id::EntityId;
use ulid::Ulid;

#[derive(EntityId, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)]
#[entity_id(prefix = "movie")]
struct MovieId(Ulid);

let movie_id = MovieId::new();

println!("{}", movie_id);
// movie_01gwe2pv0c3p1xbcfvm4n8vx08

Dependencies

~0.3–1MB
~23K SLoC