Skip to main content

BakedBootConfig

Struct BakedBootConfig 

Source
#[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: u32

0x4E524243 = b“NRBC“. A post-link tool scans for this to locate the struct.

§version: u16

Layout version (start at 1) — lets the tool/reader reject mismatched layouts.

§set_flags: u16

One 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: u32

ROS 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

Source

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

Source§

fn clone(&self) -> BakedBootConfig

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 Debug for BakedBootConfig

Source§

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

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

impl Copy for BakedBootConfig

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, 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.