pub struct EnvRung<'a> {
pub locator: Option<&'a str>,
pub domain_id: Option<u32>,
pub mode: Option<SessionMode>,
pub node_name: Option<&'a str>,
pub namespace: Option<&'a str>,
pub rmw: Option<&'a str>,
}Expand description
The environment rung of precedence model A, as VALUES.
issue 0687 — try_resolve used to take hosted_env: bool and read the
process environment itself, which is why this crate needed std. A rung is
a set of values, not a place they come from: the hosted edge
(nros::env::resolve_hosted) reads $NROS_LOCATOR, $ROS_DOMAIN_ID,
$NROS_SESSION_MODE, $NROS_NODE_NAME and $NROS_RMW and fills this in;
an embedded caller that wants the same precedence from some other source (a
settings partition, a Kconfig blob) can fill it too, which the bool could
never express.
None on a field means “the environment did not speak” — resolution falls
through to baked, then to the compiled default. The old bool’s
hosted_env=false is None here at the whole-rung level.
Fields§
§locator: Option<&'a str>$NROS_LOCATOR (the retired ZENOH_LOCATOR is refused at the edge).
domain_id: Option<u32>$ROS_DOMAIN_ID, already parsed — a malformed value is the EDGE’s
error (BootConfigError::DomainIdParse), reported before it gets
here, because only the edge knows the text.
mode: Option<SessionMode>$NROS_SESSION_MODE (the retired ZENOH_MODE is refused at the edge).
node_name: Option<&'a str>$NROS_NODE_NAME.
namespace: Option<&'a str>$NROS_NODE_NAMESPACE.
Issue 0794 — this rung did not exist, so the namespace had TWO levels
(explicit, baked) where every other field of this struct had three, and
RFC-0045 said nothing about the asymmetry. It was not a decision that a
namespace is un-overridable identity: node_name is identity too and
has always had its rung, and ROS 2 itself honours $ROS_NAMESPACE. It
was the same unwired-producer shape as the baked rung one level down.
The name is $NROS_NODE_NAMESPACE — the nano-ros vocabulary, matching
$NROS_NODE_NAME. $ROS_NAMESPACE is deliberately NOT folded in, for
the reason rmw_selector does not fold in $RMW_IMPLEMENTATION: a
variable this tree does not own would start deciding identity for every
nano-ros process in a sourced ROS shell, which is a behaviour change no
nano-ros config asked for.
rmw: Option<&'a str>$NROS_RMW — the backend selector, resolved through
nros::rmw_selector so every reader agrees on what “unset” means.