1use serde::{Serialize, Deserialize};
2
3#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
5pub struct Role {
6 pub name: String,
8
9 pub description: Option<String>,
11}
12
13impl Role {
14 pub fn new(name: impl Into<String>) -> Self {
15 Self {
16 name: name.into(),
17 description: None,
18 }
19 }
20
21 pub fn with_description(name: impl Into<String>, description: impl Into<String>) -> Self {
22 Self {
23 name: name.into(),
24 description: Some(description.into()),
25 }
26 }
27}