pub fn parse_interface_file(
pkg_name: &str,
file_path: &Path,
) -> ParseResult<InterfaceSpecification>Expand description
Parse any ROS2 interface file based on its extension
Automatically detects the file type based on the extension:
.msgfiles are parsed as messages.srvfiles are parsed as services.actionfiles are parsed as actions
§Arguments
pkg_name- The package name containing the interfacefile_path- Path to the interface file
§Returns
Returns an InterfaceSpecification enum containing the parsed specification
§Errors
Returns an error if:
- The file extension is not recognized (must be .msg, .srv, or .action)
- The file cannot be read
- The content cannot be parsed for the detected file type