open-rmf / open-rmf/crossflow

Support conversion between types

Open
#66 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
72
Forks
16
PR merge metrics
No merged PRs in 30d

Description

Rust has excellent support for converting between data types with the Into, From, TryFrom, and TryInto traits. We could leverage these traits to allow users to register conversions between message types. We could support implicit conversion for any output type that supports Into<T> for its target input.

We could also support implicit conversion when TryInto is available, but this might be an opt-in setting that the user toggles at the diagram level or inside the specific node where the implicit conversion should be allowed. Just like implicit deserialization, an implicit TryInto would direct errors towards the on_implicit_error target.

We should also automatically support implicit conversions from smaller primitives to larger primitives where there is no risk of overflow or loss of precision, e.g. i8 -> i16 -> i32 -> i64, or less obviously u8 -> i16, u16 -> i32.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the existing implicit deserialization behavior and how nodes route errors to the on_implicit_error target. Define the intended behavior for Into, opt-in TryInto, and lossless primitive conversions, including where conversion settings belong and how successful and failed conversions should be recognized as done.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.