Crate roslibrust_codegen

Source
Expand description

A library for generating rust type definitions from ROS IDL files Supports both ROS1 and ROS2. Generated types implement roslibrust’s MessageType and ServiceType traits making them compatible with all roslibrust backends.

This library is a pure rust implementation from scratch and requires no ROS installation.

See example_package for how best to integrate this crate with build.rs

Directly depending on this crate is not recommended. Instead access it via roslibrust with the codegen feature enabled.

Re-exports§

pub use ::serde;
pub use serde_bytes;
pub use integral_types::*;

Modules§

integral_types
utils

Structs§

ConstantInfo
Describes all information for a constant within a message Note: Constants are not fully supported yet (waiting on codegen support)
FieldInfo
Describes all information for an individual field
FieldType
Describes the type for an individual field in a message
MessageFile
RosLiteral
Stores the ROS string representation of a literal
ServiceFile

Traits§

BigArray
The big array serialization helper trait
Deserialize
A data structure that can be deserialized from any data format supported by Serde.
DeserializeOwned
A data structure that can be deserialized without borrowing any data from the deserializer.
Serialize
A data structure that can be serialized into any data format supported by Serde.

Functions§

find_and_generate_ros_messages
Searches a list of paths for ROS packages and generates struct definitions and implementations for message files and service files in packages it finds. Returns a tuple of the generated source code and list of file system paths that if modified would trigger re-generation of the source. This function is designed to be used either in a build.rs file or via the roslibrust_codegen_macro crate.
find_and_generate_ros_messages_without_ros_package_path
Searches a list of paths for ROS packages and generates struct definitions and implementations for message files and service files in packages it finds. Returns a tuple of the generated source code and list of file system paths that if modified would trigger re-generation of the source. This function is designed to be used either in a build.rs file or via the roslibrust_codegen_macro crate.
find_and_parse_ros_messages
Searches a list of paths for ROS packages to find their associated message and service files, parsing and performing dependency resolution on those it finds. Returns a map of PACKAGE_NAME/MESSAGE_NAME strings to message file data and vector of service file data.
generate_ros_messages_for_packages
Generates struct definitions and implementations for message and service files in the given packages.
generate_rust_ros_message_definitions
Takes in collections of ROS message and ROS service data and generates Rust source code corresponding to the definitions.
resolve_dependency_graph

Derive Macros§

Deserialize
Serialize
SmartDefault
Smart Default