pub trait RoleLike:
Clone
+ Send
+ Sync {
type Permission: PermissionLike;
// Required methods
fn name(&self) -> &str;
fn permissions(&self) -> &[Self::Permission];
// Provided method
fn description(&self) -> Option<&str> { ... }
}Expand description
Trait for role-like types
Implement this trait for your domain Role entity.
Required Associated Types§
Sourcetype Permission: PermissionLike
type Permission: PermissionLike
The permission type this role uses
Required Methods§
Sourcefn permissions(&self) -> &[Self::Permission]
fn permissions(&self) -> &[Self::Permission]
Permissions assigned to this role
Provided Methods§
Sourcefn description(&self) -> Option<&str>
fn description(&self) -> Option<&str>
Optional description
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".