Skip to content

Expand the datatypes in rust port #646

@tanu15-png

Description

@tanu15-png

Context

The current implementation of rust loader only supports a limited subset of Rust datatypes into MetaCall type conversions.
The goal of this issue is to track which types are already supported and which ones are still missing.
This also helps unify the metacall protocol representation with the Rust side.

Currently working

From testing the example script:

-bool → METACALL_BOOL
-char → METACALL_CHAR
-i16 → METACALL_SHORT
-i32 → METACALL_INT
-i64 → METACALL_LONG
-f32 → METACALL_FLOAT
-f64 → METACALL_DOUBLE
-String → METACALL_STRING
-Vec → METACALL_BUFFER
-Vec → METACALL_ARRAY
-HashMap<String, T> → METACALL_MAP

Missing types

The following types likely need implementation or verification in the (rs_port) and value conversion layer:

Primitive types

  • i8 / i128
  • u8 / u16 / u32 / u64 / u128
  • f64
  • bool
  • char

Optional and Result types

  • Option
  • Result<T, E>

Collections

  • Vec (other than i8)
  • Vec<Vec>
  • Tuple types
  • Structs

Complex types

  • Enums
  • Nested maps / arrays
  • Null / unit type ()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions