Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Environment

env(name: string)

Returns string

Read a variable: first from --env-file/<scenario>.env/load_env, then the process environment. Errors if unset. Use it for per-env credentials.

Example

#![allow(unused)]
fn main() {
let dom = env("SIP_DOMAIN");
let a = agent("A", #{ username: env("A_USER"), domain: dom, password: env("A_PASS") });
}

load_env(path: string)

Load a dotenv file (KEY=VALUE lines) into env(...) for this scenario, resolved relative to the scenario file. Later loads override earlier keys.