pub struct RunExternalArgs {
pub env: Option<EnvName>,
pub token: Option<String>,
pub bot_id: Option<String>,
pub max_matches: Option<u64>,
pub safe_mode: bool,
}Expand description
Parsed run-external flags, mirroring the Python CLI
(--env/--token/--bot-id/--max-matches/--no-safe-mode).
Rust cannot dynamically load a bot from a file the way Python’s
chipzen run-external my_bot.py does — a Rust bot is compiled into a
binary. The equivalent is run_external_cli: wire it into your own
bot binary’s main (the scaffolded starter does this for you) and it
loads chipzen.toml, resolves the env-aware lobby URL, and runs your
bot via run_external_bot. Build this struct however you like — from
clap, from env vars, or by hand — so this crate stays argument-parser
agnostic.
Fields§
§env: Option<EnvName>--env prod|staging|local. None consults $CHIPZEN_ENV then
defaults to prod.
token: Option<String>--token. Overrides [external_api].token in chipzen.toml.
bot_id: Option<String>--bot-id. Overrides [external_api].bot_id. Required when no
[external_api].url is configured.
max_matches: Option<u64>--max-matches. None runs until the lobby closes (tournament
check-in); Some(1) plays a single challenge.
safe_mode: bool--no-safe-mode sets this to false (let a decide() panic crash
the process). Defaults to true.
Implementations§
Trait Implementations§
Source§impl Clone for RunExternalArgs
impl Clone for RunExternalArgs
Source§fn clone(&self) -> RunExternalArgs
fn clone(&self) -> RunExternalArgs
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more