pub struct Bots { /* private fields */ }Implementations§
Source§impl Bots
impl Bots
Sourcepub fn empty() -> Self
pub fn empty() -> Self
No bots: the state of every config that does not carry [bots], and of every test that
builds crate::app::AppState by hand. The page then renders exactly what it did before
there were bots (#509).
Sourcepub fn build(cfg: &Config, env: EnvFn<'_>) -> Self
pub fn build(cfg: &Config, env: EnvFn<'_>) -> Self
Build one agent per declared bot.
A failure is kept, not fatal: a bot with a missing instructions file or a memory path that cannot be resolved must not be able to take the human’s dashboard down with it. The tab names the failure and the bot answers nothing, which is the honest pair.
pub fn is_empty(&self) -> bool
Sourcepub fn declared(&self) -> impl Iterator<Item = (&str, &BotConfig)>
pub fn declared(&self) -> impl Iterator<Item = (&str, &BotConfig)>
The bot’s name and declaration, in the order the config declared them.
Sourcepub fn agent(&self, name: &str) -> Option<&BotAgent>
pub fn agent(&self, name: &str) -> Option<&BotAgent>
The agent one bot’s conversation runs on, or why it cannot run.
Sourcepub fn declares(&self, name: &str) -> bool
pub fn declares(&self, name: &str) -> bool
Whether name is declared at all — the difference between “no such bot” and “this bot is
declared and broken”, which are a 404 and a 503 in crate::app.