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