Expand description
Compile-time opaque storage sizes for FFI consumers.
See sizes for the export_size! pattern used to expose these values
to nros-c / nros-cpp at build time.
Single source of truth for FFI opaque-storage sizes.
Each export_size! invocation produces two artefacts:
pub const FOO_SIZE: usize = core::mem::size_of::<T>();— a normal Rust const suitable for in-crateconst _: () = assert!(...)checks and direct use byno_stdconsumers.pub static __NROS_SIZE_FOO: [u8; FOO_SIZE] = [0; FOO_SIZE];— an array-sized static whose symbol storage size in the compiled rlib equalsFOO_SIZE.nros-c/nros-cppbuild scripts read the sizes out vianros_sizes_build::extract_sizesto derive opaque-storage macros for the generated C/C++ headers.
§The markers exist ONLY in the size probe’s own build (issue 1765)
The statics, and the __NROS_SIZE_FN_* fn-pointer markers beside them, are
compiled only under feature = "ffi-size-markers". Exactly one party
requests that feature: the nested probe cargo behind
nros-build-helpers::shared::probe_nros_sizes, which builds nros in its
OWN target directory. No shipped dep-site enables it, and build.rs makes
enabling it outside the probe a compile error.
It used to be requested on nros-c’s and nros-cpp‘s nros dependency,
so the markers were part of the linked staticlib: #[no_mangle] immutable
statics, which a staticlib exports and the board linker scripts place in
.text. Every C/C++ image paid the SUM of the probed sizes in flash, as
zero bytes (111,252 B of a 587,256 B FreeRTOS C zenoh talker), and once
phase-382 W3’ carved the parameter store into EXECUTOR_SIZE, a second
280 KB copy of the store. The pub consts are unaffected: they are what
in-crate asserts and no_std consumers read, and a const occupies nothing.
Feature gating follows the rest of the crate: the statics only exist when
an RMW backend (rmw-zenoh / rmw-xrce / rmw-cyclonedds / rmw-cffi) is
active, which is exactly the condition under which the Rmw* type
aliases resolve. Workspace-level cargo check without any RMW feature
sees this module as empty.
Constants§
- ACTION_
SERVER_ INTERNAL_ SIZE - ACTION_
SERVER_ RAW_ HANDLE_ SIZE - CPP_
ACTION_ CLIENT_ SIZE - CPP_
ACTION_ SERVER_ SIZE - EXECUTOR_
SIZE - EXECUTOR_
VALUE_ SIZE - GUARD_
CONDITION_ SIZE - LIFECYCLE_
CTX_ SIZE - PUBLISHER_
SIZE - RAW_
ACTION_ CLIENT_ SIZE - RAW_
ACTION_ SERVER_ SIZE - RAW_
SERVICE_ CLIENT_ SIZE - RAW_
SERVICE_ SERVER_ SIZE - RAW_
SUBSCRIPTION_ SIZE - SERVICE_
CLIENT_ SIZE - SERVICE_
SERVER_ SIZE - SESSION_
SIZE - SUBSCRIBER_
SIZE