Expand description
The environment surface a node reads at start-up (blueprint §24.2).
Everything here is read, never written: a node inspects its environment
once, during init, and from then on the values live in typed fields. The
module exists so that the set of variables AstRS reads is enumerable in one
place — astrs doctor (§17) prints exactly this table.
| Variable | Read by | Default |
|---|---|---|
ASTRS_NODE_CONFIG | crate::Node::init_from_env | — (required) |
ASTRS_RUN_PARENT_PID | the orphan guard (§4.2) | no guard |
ASTRS_DAEMON_PORT | dynamic attach (§8.3) | 7408 |
ASTRS_RUNTIME_DIR | dynamic attach | $XDG_RUNTIME_DIR/astrs |
ASTRS_ZERO_COPY_THRESHOLD | the send path (§6.2) | 4096 |
ASTRS_TYPE_CHECK | typed handles (§9.2) | warn |
§Examples
use astrs_node_api::env::TypeCheckMode;
assert_eq!("warn".parse(), Ok(TypeCheckMode::Warn));
assert!(TypeCheckMode::Error.is_fatal());
assert!(!TypeCheckMode::default().is_fatal(), "0.1.0 defaults to warn");Enums§
- Type
Check Mode - How strictly a typed handle checks a port’s declared URN (§9.2).
Constants§
- DAEMON_
SOCKET_ NAME - The daemon’s Unix-domain socket name inside the runtime directory (§4.2).
- DEFAULT_
DAEMON_ PORT - The daemon’s loopback node port (§24.2).
- ENV_
DAEMON_ PORT - The environment variable overriding the daemon’s loopback node port.
- ENV_
RUNTIME_ DIR - The environment variable overriding the runtime directory.
- ENV_
TYPE_ CHECK - The environment variable selecting the runtime type-check mode (§9.2).
- ENV_
XDG_ RUNTIME_ DIR - The freedesktop variable the default runtime directory is derived from.
- ENV_
ZERO_ COPY_ THRESHOLD - The environment variable overriding the zero-copy threshold.
- READ_
VARIABLES - Every environment variable this crate reads, in documentation order.
- RUNTIME_
DIR_ LEAF - The runtime directory leaf appended to
$XDG_RUNTIME_DIR. - SHM_
BROKER_ SOCKET_ NAME - The shared-memory broker socket name inside the runtime directory (§6.2).
Functions§
- daemon_
port - Reads
ASTRS_DAEMON_PORT, defaulting toDEFAULT_DAEMON_PORT. - daemon_
socket_ path - The daemon’s Unix-domain socket path under
runtime_dir. - parent_
pid - Reads
ASTRS_RUN_PARENT_PID, when it is set (§4.2). - runtime_
dir - The runtime directory for this process (§24.2).
- shm_
broker_ path - The shared-memory broker socket path under
runtime_dir. - zero_
copy_ threshold - Reads
ASTRS_ZERO_COPY_THRESHOLD, defaulting to the §24.2 4 KiB.