std::env
std::env provides access to process environment variables and common
directory helpers.
Full reference: env.
Example: get#
import std::env;
import { println } from "std/io";
fn main () -> int {
let v_opt = std::env::get("HOME");
match (v_opt) {
Some(v) => println("HOME = {}", v),
None => println("HOME is not set"),
};
return 0;
}
See also#
- Full reference: env
- Typed errors: typed errors
Source repository · Edit this page · View Markdown