std/environ
Enumerate the whole process environment, which is what a language runtime needs to expose something like Node's process.env. To read or set one variable by name, use std/env.
milo
from "std/environ" import { envVars, EnvEntry }Example
milo
for e in envVars() {
if e.name == "HOME" {
print(e.value)
}
}API reference
std/environ has one implementation per target (darwin, linux, windows); the resolver picks the one for the target you build for.
EnvEntry
milo
pub struct EnvEntryFields: name: string, value: string.
Functions
envVars
milo
pub fn envVars(): Vec<EnvEntry>Every variable in the process environment, in the order the OS supplies them. Recorded and replayed under MILO_RECORD / MILO_REPLAY (std/replay).