entid 0.4.3

A library for generating and validating type-safe, prefixed entity identifiers based on UUIDs and ULIDs
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
/* Copyright © 2025, CosmicMind, Inc. */

use entid::{Prefix, UuidEntityId};

#[derive(Prefix)]
#[entid(prefix = "user", delimiter = "_")]
struct User;

fn main() {
    let user_id = UuidEntityId::<User>::generate();
    println!("User ID: {}", user_id);
    assert!(user_id.to_string().starts_with("user_"));
}