pub trait RosFieldType {
// Required method
fn ros_field_type() -> FieldType;
// Provided method
fn referenced_types() -> Vec<IndividualTypeDescription> { ... }
}Expand description
Trait for types that can be used as fields in ROS2 messages.
Each type knows how to describe itself as a ROS2 field type. This provides a clean, type-safe way to map Rust types to ROS2 field types without complex compile-time type path analysis.
Required Methods§
Sourcefn ros_field_type() -> FieldType
fn ros_field_type() -> FieldType
Returns the FieldType for this type when used as a field.
Provided Methods§
Sourcefn referenced_types() -> Vec<IndividualTypeDescription>
fn referenced_types() -> Vec<IndividualTypeDescription>
Returns referenced type descriptions (empty for primitives, populated for nested types).
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.