bytecodealliance / bytecodealliance/wasmtime
Add `matches` function to all types structs
- Dominant language
- Rust
- Stars
- 18.6k
- Forks
- 1.8k
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 126
Description
#### 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](https://github.com/wasmi-labs/wasmi/pull/1742) 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.
Contributor guide
Assessment
This issue has not been assessed yet.