Reimplement the C# API.

This commit reimplements the C# API in terms of a Wasmtime linker.

It removes the custom binding implementation that was based on reflection in
favor of the linker's implementation.

This should make the C# API a little closer to the Rust API.

The `Engine` and `Store` types have been hidden behind the `Host` type which is
responsible for hosting WebAssembly module instances.

Documentation and tests have been updated.
This commit is contained in:
Peter Huene
2020-03-24 18:20:22 -07:00
parent 0d5d63fdb1
commit cf1d9ee857
38 changed files with 2149 additions and 2213 deletions

View File

@@ -15,11 +15,6 @@ namespace Wasmtime.Tests
public class GlobalExportsTests : IClassFixture<GlobalExportsFixture>
{
public class Host : IHost
{
public Instance Instance { get; set; }
}
public GlobalExportsTests(GlobalExportsFixture fixture)
{
Fixture = fixture;
@@ -46,7 +41,7 @@ namespace Wasmtime.Tests
[Fact]
public void ItCreatesExternsForTheGlobals()
{
using var instance = Fixture.Module.Instantiate(new Host());
using var instance = Fixture.Host.Instantiate(Fixture.Module);
dynamic dyn = instance;
var globals = instance.Externs.Globals;