uuid-enum

Crates.iouuid-enum
lib.rsuuid-enum
version0.1.0
created_at2025-12-09 07:09:39.450476+00
updated_at2025-12-09 07:09:39.450476+00
descriptionUUID-based enums.
homepagehttps://github.com/metastable-void/uuid-enum
repositoryhttps://github.com/metastable-void/uuid-enum
max_upload_size
id1974969
size34,640
Yuka MORI (metastable-void)

documentation

README

uuid-enum

uuid-enum is a tiny facade crate that re-exports the uuid_enum derive macro and the uuid crate so you can describe discriminants for enums with stable UUIDs in one dependency.

Installation

[dependencies]
uuid-enum = "0.1"

Usage

use uuid_enum::uuid_enum;

#[uuid_enum]
pub enum AccountGrant {
    #[uuid("bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb")]
    Owner,
    #[uuid("cccccccc-cccc-cccc-cccc-cccccccccccc")]
    Manage,
}

The macro injects impls that let you convert between the enum variants and uuid::Uuid values, while uuid-enum also exposes the uuid crate (and its Uuid type) under the same namespace for convenience.

License

Licensed under either the Apache License 2.0 or the Mozilla Public License 2.0 at your option.

Commit count: 0

cargo fmt