pub struct Env {
pub runner: Arc<dyn CommandRunner>,
pub out: SharedWriter,
pub err: SharedWriter,
pub cwd: PathBuf,
pub env: Arc<dyn EnvProvider>,
pub time: Arc<dyn TimeProvider>,
pub vertex: ReasoningEngineOptions,
}Expand description
Everything a command reads or writes outside the process (stdout, stderr, the working directory, the environment, the clock and child processes).
Fields§
§runner: Arc<dyn CommandRunner>Launches child processes (gcloud, cargo metadata).
out: SharedWriterStandard output: step banners, printer lines and child output.
err: SharedWriterStandard error: the Error: line and usage.
cwd: PathBufThe working directory: relative paths resolve against it.
env: Arc<dyn EnvProvider>The environment (PATH for command lookup, TMPDIR for the temp dir).
time: Arc<dyn TimeProvider>The clock.
vertex: ReasoningEngineOptionsHow gadk deploy agentengine reaches Vertex AI (endpoint, credentials and HTTP client are
injectable for tests). An unset
ReasoningEngineOptions::env means Env::env.
Implementations§
Source§impl Env
impl Env
Sourcepub fn new(
runner: Arc<dyn CommandRunner>,
out: SharedWriter,
err: SharedWriter,
cwd: PathBuf,
env: Arc<dyn EnvProvider>,
time: Arc<dyn TimeProvider>,
) -> Env
pub fn new( runner: Arc<dyn CommandRunner>, out: SharedWriter, err: SharedWriter, cwd: PathBuf, env: Arc<dyn EnvProvider>, time: Arc<dyn TimeProvider>, ) -> Env
An Env from its parts, with default Vertex options (tests set Env::vertex on the
built value). Outside this file an Env is built only here, by Env::process or by
the test builder, never by a struct literal.
Sourcepub fn process() -> Env
pub fn process() -> Env
The production environment: real processes, stdout/stderr, the current directory (empty when it cannot be read), the process environment, the system clock and Vertex AI at its regional endpoint with Application Default Credentials.