Skip to main content

DeployOverlay

Struct DeployOverlay 

Source
pub struct DeployOverlay {
    pub locator: Option<&'static str>,
    pub net: Option<&'static str>,
    pub domain_id: Option<u32>,
    pub transport: Option<LinkKind>,
    pub rmw: Option<&'static str>,
    pub node_name: Option<&'static str>,
    pub boot_config: Option<&'static BakedBootConfig>,
}
Expand description

Deploy-metadata overlay threaded from nros::main!() into the board’s boot config (issue #48 cause 1).

The nros::main!() macro reads the Entry pkg’s [package.metadata.nros.deploy.<board>] block at expansion time and bakes the present keys here. Each field is None when the deploy block omitted it, so the board overlays only the supplied values onto its own Config::default() (the firmware’s compiled-in default stays the source of truth for everything the deploy block does not name).

Boards whose BoardEntry::run ignores network/locator config (POSIX hosts, RTIC/Embassy MCUs that take their transport elsewhere) inherit the default BoardEntry::run_with_deploy body, which drops the overlay and calls BoardEntry::run — so adding a network field here never touches those boards. The exception is node_name: hosted boards override run_with_deploy to apply it to the boot config (issue #98), since the ROS graph node name is a launch identity, not a network knob.

Fields§

§locator: Option<&'static str>

locator = "tcp/10.0.2.2:7451" — the zenoh/RMW endpoint the firmware dials. None → keep the board default.

§net: Option<&'static str>

The image’s resolved network (RFC-0103 D10f, phase-497 W2): the NROS_IMAGE_NET text nros sync rendered from [image.<id>.net.<if>], [network.<name>] and the board’s [board.net], baked verbatim. None → the image states no interface; keep the board default. Decoded by nros_board_common::image_net — this crate carries it, it does not read it.

It replaced three fields (ip, gateway, netmask) that nros::main! lowered from system.toml itself: the macro has no board catalog, so it could not take a board’s default network or derive a MAC, and one fact would have resolved two ways.

§domain_id: Option<u32>

domain_id = 0 — ROS 2 domain. None → keep the board default.

§transport: Option<LinkKind>

[image.<id>] transport = "serial" — the LINK kind the image rides (RFC-0086 D2). None → the board’s default link. Read by BoardEntry::setup_transport (phase-244.D1), which may install a board custom transport for it BEFORE the linked RMW registers.

Typed, not a string (issue 1601): phase-445 W6 moved the leaf key from the RMW name ("xrce") to the link kind ("serial"), and the one board reading it kept comparing against "xrce" — a comparison that could no longer be true and compiled anyway. A LinkKind cannot be compared against an RMW name.

§rmw: Option<&'static str>

rmw = "xrce" — the RMW backend the image declares ([image.<id>] rmw > [image_defaults] rmw > [system] rmw), verbatim. None → not declared (a Form 2 entry, or a leaf with no system.toml).

The BACKEND choice, which transport is not: an XRCE image over a UART states both, and a board that registers a backend keys on this field (issue 1601).

§node_name: Option<&'static str>

The ROS graph node name for the primary session, baked from the launch file’s single <node name=…> / system.toml [[component]].name (issue #98). None → the board default (from_env()’s "node"). Only set by nros::main! when the launch declares exactly one node — multiple nodes share one primary session, so naming it after one component would be wrong (per-node naming is the deferred multi-node piece). Applied to the boot ExecutorConfig by the board, so unlike locator this IS honored on hosted boards (locator stays env-driven; node name is a launch identity).

§boot_config: Option<&'static BakedBootConfig>

Issue #101 / RFC-0045 — the patchable baked boot-config static (.nros_boot_config), emitted by nros::main! for embedded targets and read by the board to resolve node_name/locator/domain. None on hosted / when the macro emits no static.

Implementations§

Source§

impl DeployOverlay

Source

pub fn selects(&self, rmw: &str, link: LinkKind) -> bool

Does the image declare RMW rmw riding link link? Both halves are required: the backend is rmw, the link is [image.<id>] transport, and neither stands in for the other (issue 1601).

Trait Implementations§

Source§

impl Clone for DeployOverlay

Source§

fn clone(&self) -> DeployOverlay

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for DeployOverlay

Source§

impl Debug for DeployOverlay

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for DeployOverlay

Source§

fn default() -> DeployOverlay

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.