According to the last working notes, new interface types are s8, s16,
s32, s64, u8, u16, u32, u64, f32, f64, string, anyref, i32, and i64.
Their binary reprensentations are changing too, from 0x00 to 0x0d.
1223: feat(runtime-core) Implement `TryFrom<native_type>` for `Value` r=Hywan a=Hywan
Extracted from #1018.
This PR implements `TryFrom` for `Value`. It is required to support dynamically-typed values for polymorphic host functions.
This PR also refactors the code by using a macro (`value_conversions!`) to implement `From` and `TryFrom` in one shot.
Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
Co-authored-by: Ivan Enderlin <ivan.enderlin@wanadoo.fr>
1224: fix(runtime-core) Remove warnings r=Hywan a=Hywan
Because we can use the `impl_traits!` macro with only one identifier,
a warning is emitted saying the parenthesis are useless for this
specific usecase. They are required for all the other usecases
though. We can safely ignore this warning.
Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
Co-authored-by: Ivan Enderlin <ivan.enderlin@wanadoo.fr>
1221: doc(interface-types) Add a `README.md` file r=MarkMcCaskey a=Hywan
Just a small `README.md`, so that users aren't totally loss.
Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
Those are not necessary for the user. It's only internal
implementation, that must be public because it ends up in public
types, but the compiler infers everything automatically.
Because we can use the `impl_traits!` macro with only one identifier,
a warning is emitted saying the parenthesis are useless for this
specific usecase. They are required for all the other usecases
though. We can safely ignore this warning.