puuid 0.1.1

Prefixed UUIDs: Type-safe, string-prefixed UUIDs that behave like standard UUIDs.
Documentation
/// A trait that defines the prefix string for a specific ID type.
///
/// This is typically implemented by zero-sized unit structs.
pub trait Prefix {
    /// The string prefix (e.g., "user", "order").
    /// Note: The library automatically adds the underscore separator.
    const VALUE: &'static str;
}

/// Defines a Prefix unit struct for use with [`crate::Puuid`].
///
/// # Example
/// ```rust
/// use puuid::prefix;
///
/// // Defines a public struct 'User' with prefix "user"
/// prefix!(pub User, "user");
///
/// // Defines a private struct 'Secret' with prefix "sk"
/// prefix!(Secret, "sk");
/// ```
#[macro_export]
macro_rules! prefix {
    // Branch for public visibility
    ($vis:vis $name:ident, $prefix:literal) => {
        #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
        $vis struct $name;

        impl $crate::Prefix for $name {
            const VALUE: &'static str = $prefix;
        }
    };
}