disma/domain/role/
awaiting.rs

1use std::sync::Arc;
2
3use crate::permission::PermissionsList;
4
5use super::{ExtraRolesStrategy, Role, RolesList};
6
7#[derive(Debug)]
8pub struct AwaitingRolesList {
9    pub items: RolesList<AwaitingRole>,
10    pub extra_items_strategy: Arc<dyn ExtraRolesStrategy>,
11}
12
13impl PartialEq for AwaitingRolesList {
14    fn eq(&self, other: &Self) -> bool {
15        self.items == other.items
16            && self.extra_items_strategy._type() == other.extra_items_strategy._type()
17    }
18}
19
20#[derive(Clone, Debug, PartialEq)]
21pub struct AwaitingRole {
22    pub name: String,
23    pub permissions: PermissionsList,
24    pub color: Option<String>,
25    pub is_mentionable: bool,
26    pub show_in_sidebar: bool,
27}
28
29impl Role for AwaitingRole {
30    fn name(&self) -> &str {
31        &self.name
32    }
33}