Skip to content

Add matches function to all types structs #12193

@BoilingFusion

Description

@BoilingFusion

Feature

Currently there exist FuncType::matches and ValType::matches.

Add matches functions to:

  • ExternType
  • GlobalType
  • TableType
  • TagType

Benefit

Quickly checking if a type conforms to an interface.
Asking this in relation to this wasmi pull request to know if there are any plans on implementing functions like this.

Implementation

I think it should be possible to compare all fields for either equality or to use the matches functions that are already written.

Alternatives

These functions do not have to be written in this crate. They can also be added by users of the library if necessary.

Metadata

Metadata

Assignees

No one assigned

    Labels

    wasmtime:apiRelated to the API of the `wasmtime` crate itself

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions