Skip to content

maxdeviant/entity-id

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

entity_id

crates.io docs.rs crates.io CI

Production-grade entity IDs for your web application.

Features

  • All the features of ULIDs
  • Prefixed IDs à la Stripe (cus_01gwfyayqspvsdqzd32nh44psh)
  • Easy conversion to and from UUIDs

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published