use super::ServerConfig;
use crate::agents::config::AgentsConfig;
impl ServerConfig {
#[must_use]
pub fn agents_config(&self) -> Option<AgentsConfig> {
self.agents.or_else(|| {
self.auth
.as_ref()
.and_then(|auth| auth.lys.as_ref())
.and_then(|lys| lys.agents)
})
}
#[must_use]
pub fn agents_place(&self) -> &'static str {
if self.agents.is_some() {
"top"
} else if self.agents_config().is_some() {
"auth.lys"
} else {
"none"
}
}
}