use std::{collections::HashSet, fmt::Display};
use crate::raw::RawUserInfo;
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct UserInfo {
pub desc: String,
pub roles: HashSet<String>,
pub disabled: bool,
pub memory_limit: usize,
}
impl Display for UserInfo {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{:?}", self)
}
}
impl UserInfo {
pub(crate) fn from_raw(raw: &RawUserInfo) -> Self {
UserInfo {
desc: raw.desc(),
roles: raw.roles(),
disabled: raw.disabled(),
memory_limit: raw.memory_limit(),
}
}
}