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:
@@ -13,11 +13,6 @@ namespace Wasmtime.Tests
|
||||
|
||||
public class MemoryExportsTests : IClassFixture<MemoryExportsFixture>
|
||||
{
|
||||
public class Host : IHost
|
||||
{
|
||||
public Instance Instance { get; set; }
|
||||
}
|
||||
|
||||
public MemoryExportsTests(MemoryExportsFixture fixture)
|
||||
{
|
||||
Fixture = fixture;
|
||||
@@ -44,8 +39,7 @@ namespace Wasmtime.Tests
|
||||
[Fact]
|
||||
public void ItCreatesExternsForTheMemories()
|
||||
{
|
||||
var host = new Host();
|
||||
using var instance = Fixture.Module.Instantiate(host);
|
||||
using var instance = Fixture.Host.Instantiate(Fixture.Module);
|
||||
|
||||
instance.Externs.Memories.Count.Should().Be(1);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user