1use crate::common::Identifier;
2use std::fmt::{Display, Formatter};
3
4#[derive(PartialEq, Debug, Clone)]
6pub struct ListRole {
7 pub of: Option<Identifier>,
9 pub no_recurse: bool,
11}
12
13impl Display for ListRole {
14 fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
15 let mut s: String = "".to_string();
16 if let Some(of) = &self.of {
17 s = " OF ".to_string();
18 s.push_str(of.to_string().as_str());
19 }
20 write!(
21 f,
22 "LIST ROLES{}{}",
23 s.as_str(),
24 if self.no_recurse { " NORECURSIVE" } else { "" }
25 )
26 }
27}