Skip to main content

Module sizes

Module sizes 

Source
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-crate const _: () = assert!(...) checks and direct use by no_std consumers.
  • pub static __NROS_SIZE_FOO: [u8; FOO_SIZE] = [0; FOO_SIZE]; — an array-sized static whose symbol storage size in the compiled rlib equals FOO_SIZE. nros-c/nros-cpp build scripts read the sizes out via nros_sizes_build::extract_sizes to derive opaque-storage macros for the generated C/C++ headers.

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