newtype-uuid-macros
Procedural macro for newtype-uuid.
This crate provides a procedural macro to help with creating
newtype-uuid instances.
For more information, see the documentation for impl_typed_uuid_kinds!.
Examples
Basic usage:
use TypedUuidKind;
use impl_typed_uuid_kinds;
impl_typed_uuid_kinds!
// This generates empty UserKind and BusinessUnitKind enums implementing
// TypedUuidKind, with the tags "user" and "business_unit" respectively.
// Tags are snake_case versions of type names.
assert_eq!;
assert_eq!;
// The macro also generates UserUuid and BusinessUnitUuid type aliases.
let user_uuid = new_v4;
let business_unit_uuid = new_v4;
For more details and examples, see the documentation for
impl_typed_uuid_kinds!.
License
This project is available under the terms of either the Apache 2.0 license or the MIT license.