Crate bit_roles_macros

Crate bit_roles_macros 

Source
Expand description

§Bit Roles Macros

This crate enables you to implement granular role and permission management based on bit flags.

Derive Macros§

BitRole
Bit role manager with compile-time value checking. Useful when you have a simple role enum definition and do not wish to work with raw integer role values. Each variant of your role enum must return a valid role value that is either zero or a power of two. Your role enum must also derive the Copy and Clone traits.
BitRoleUnchecked
Bit role manager without value checking. Useful when you want to use raw integer role values or you have a complex role enum definition. This requires you to implement the Into<usize> trait for your role enum yourself, and each variant must return a valid role value that is either zero or a power of two. Your role enum must also derive the Copy and Clone traits.