Skip to main content

RosFieldType

Trait RosFieldType 

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

Source

fn ros_field_type() -> FieldType

Returns the FieldType for this type when used as a field.

Provided Methods§

Source

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.

Implementations on Foreign Types§

Source§

impl RosFieldType for bool

Source§

impl RosFieldType for f32

Source§

impl RosFieldType for f64

Source§

impl RosFieldType for i8

Source§

impl RosFieldType for i16

Source§

impl RosFieldType for i32

Source§

impl RosFieldType for i64

Source§

impl RosFieldType for u8

Source§

impl RosFieldType for u16

Source§

impl RosFieldType for u32

Source§

impl RosFieldType for u64

Source§

impl RosFieldType for String

Source§

impl<T: RosFieldType> RosFieldType for Vec<T>

Source§

impl<T: RosFieldType, const N: usize> RosFieldType for [T; N]

Implementors§