Skip to main content

Message

Trait Message 

Source
pub trait Message: Sized {
    const TYPE_NAME: &'static str;
    const FIELDS: &'static [Field];
}
Expand description

Trait implemented by every generated ROS message type for runtime introspection.

Provides the ROS type name plus the static field schema. Implementors also typically implement crate::Serialize + crate::Deserialize for the CDR fast path; this trait is the introspection surface used by RMW backends that build type descriptors at runtime.

All items are &'static, so the trait is fully usable in no_std + alloc-free environments. The blanket bound is just Sized — no Serialize / Deserialize super-bound, so verification-only mirror types (nros-ghost-types) and CycloneDDS-only “descriptor probe” types can implement Message without dragging the CDR codecs in.

Required Associated Constants§

Source

const TYPE_NAME: &'static str

ROS topic-type name in package/msg/Type form (e.g. "std_msgs/msg/String").

Wire-level DDS encoding ("std_msgs::msg::dds_::String_") is the concern of the per-RMW topic-name renderer, not this trait.

Source

const FIELDS: &'static [Field]

Field schema in declaration order.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§