26 lines
487 B
Rust
26 lines
487 B
Rust
//! Handle all Ids functionalities
|
|
//!
|
|
//! Features:
|
|
//! Generating a human readable ID for a HUID
|
|
//! Finding the HUID from an ID
|
|
//! Removing ID as needed
|
|
|
|
/// Generic type representing an ID
|
|
pub type EventIdType = String;
|
|
|
|
/// Generate an id
|
|
pub fn generate_id() -> String {
|
|
human_ids::generate(None)
|
|
}
|
|
|
|
#[cfg(test)]
|
|
mod test {
|
|
use super::generate_id;
|
|
|
|
#[test]
|
|
fn test_id_generation() {
|
|
let id = generate_id();
|
|
assert!(!id.is_empty())
|
|
}
|
|
}
|