#[repr(C)]pub struct BakedBootConfig {
pub magic: u32,
pub version: u16,
pub set_flags: u16,
pub domain_id: u32,
pub node_name: [u8; 64],
pub locator: [u8; 96],
pub namespace: [u8; 64],
}Expand description
Build-time-baked boot config, emitted (in W4b) into the .nros_boot_config
linker section by the entry macro / cmake. Fixed-size + pointer-free so a
future post-link tool can patch it in place (RFC-0045). The resolver reads
it on embedded via BootConfig::from_baked (in nros-node).
Fields§
§magic: u320x4E524243 = b“NRBC“. A post-link tool scans for this to locate the struct.
version: u16Layout version (start at 1) — lets the tool/reader reject mismatched layouts.
set_flags: u16One bit per field that is baked-set (else the reader yields None → resolver
default). bit0 = node_name, bit1 = locator, bit2 = domain_id, bit3 = namespace.
domain_id: u32ROS 2 domain ID (valid only when BOOT_SET_DOMAIN bit is set).
node_name: [u8; 64]NUL-padded UTF-8; the trailing NUL bytes are not part of the value.
locator: [u8; 96]NUL-padded UTF-8 middleware locator; the trailing NUL bytes are not part of the value.
namespace: [u8; 64]NUL-padded UTF-8 node namespace; the trailing NUL bytes are not part of the value.
Implementations§
Source§impl BakedBootConfig
impl BakedBootConfig
Sourcepub const fn new(
node_name: Option<&str>,
locator: Option<&str>,
domain_id: Option<u32>,
namespace: Option<&str>,
) -> BakedBootConfig
pub const fn new( node_name: Option<&str>, locator: Option<&str>, domain_id: Option<u32>, namespace: Option<&str>, ) -> BakedBootConfig
Pack baked fields at compile time. None → field unset (bit clear,
bytes zeroed). A string longer than its fixed buffer is a
compile-time error (const panic) — never silently truncated.
must be const fn so W4b’s entry macro can use it in a static initializer.
Trait Implementations§
Source§impl Clone for BakedBootConfig
impl Clone for BakedBootConfig
Source§fn clone(&self) -> BakedBootConfig
fn clone(&self) -> BakedBootConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more