Library guide · API index and notation
This page is generated from the bundled library in this checkout. Signatures and adjacent source comments are reproduced below; the linked guide explains usage, storage, failures, and platform support.
import "std/env"
Names used in signatures
Unqualified names denote this package’s types (including other source files in the same package), language built-ins, or generic parameters such as T. Qualified names use the import aliases below. These aliases belong to the library source; import a dependency yourself to use its alias in your program.
| Alias | Package | Source file |
|---|---|---|
backend |
std/env/native |
env.dodo |
error |
std/platform/error |
env.dodo |
mem |
core/mem |
env.dodo |
native |
std/platform/native |
env.dodo |
platform |
std/platform |
env.dodo |
snapshot
Function · Source
Native Unix bytes / Windows UTF-16 are preserved, including invalid UTF-8 and unpaired surrogates. Portable callers provide both scratch types; only bytes on Unix or wide on Windows is written. Empty unused storage is valid.
pub fn snapshot(bytes: &mut[u8], wide: &mut[u16]) -> backend.Snapshot!error.Error from(bytes, wide)
arguments
Function · Source
pub fn arguments(bytes: &mut[u8], wide: &mut[u16]) -> backend.Snapshot!error.Error from(bytes, wide)
current_dir
Function · Source
pub fn current_dir(bytes: &mut[u8], wide: &mut[u16]) -> native.NativeString!error.Error from(bytes, wide)
child_environment
Function · Source
pub fn child_environment(bytes: &mut[u8], wide: &mut[u16]) -> backend.Builder from(bytes, wide)
Workspace
Struct · Source
Two reusable 4096-unit native buffers. Output UTF-8 lives in caller storage, so looking up another variable does not invalidate an earlier returned string.
pub struct Workspace {
// Private implementation fields omitted.
}
Workspace.new
Function · Source
pub fn new() -> Workspace
get
Function · Source
none is absent; some(“”) is present and empty. Names are nonempty and may not contain NUL or ‘=’. Native names are case sensitive on Linux and ordinal case insensitive on Windows. No process-global pointer escapes.
pub fn get(name: &str, output: &mut[u8], workspace: &mut Workspace, policy: platform.TextPolicy) -> Option<&str>!error.Error from(output)
Arguments
Struct · Source
Borrows an immutable native snapshot plus an iteration cursor, bounded at 32768 native units including one NUL per argument and argv[0]. The conversion policy is explicit once at capture. Failed get/next returns no string; next advances only after successful conversion, so retry with larger output is possible.
pub struct Arguments {
// Private implementation fields omitted.
}
Arguments.capture
Function · Source
pub fn capture(storage: &mut native.ListWorkspace, policy: platform.TextPolicy) -> Arguments!error.Error from(storage)
Arguments.len
Function · Source
pub fn len(&self) -> usize
Arguments.get
Function · Source
pub fn get(&self, index: usize, output: &mut[u8]) -> Option<&str>!error.Error from(output)
Arguments.next
Function · Source
pub fn next(&mut self, output: &mut[u8]) -> Option<&str>!error.Error from(output)
Arguments.rewind
Function · Source
pub fn rewind(&mut self)