1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
use *;
use crateId;
/// A type alias for a CUID-based identifier wrapped in the `Id` struct.
///
/// This is useful when IDs are represented as `Id<T, String>`, where `T` is
/// the entity type and `String` is the CUID.
pub type CuidId<T> = ;
/// A generator for creating CUID-based unique identifiers.
///
/// This implementation uses the [`cuid2`](https://docs.rs/cuid2) crate to generate collision-resistant
/// unique IDs optimized for distributed systems.
///
/// # Example
/// ```
/// use tagid::{IdGenerator, CuidGenerator};
///
/// let new_id = CuidGenerator::next_id_rep();
/// println!("Generated CUID: {}", new_id);
/// ```
;