Implement WASI C API.
This commit implements an initial WASI C API that can be used to instantiate and configure a WASI instance from C. This also implements a `WasiBuilder` for the C# API enabling .NET hosts to bind to Wasmtime's WASI implementation.
This commit is contained in:
23
crates/misc/dotnet/src/Bindings/WasiBinding.cs
Normal file
23
crates/misc/dotnet/src/Bindings/WasiBinding.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Wasmtime.Bindings
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a binding to a WASI export.
|
||||
/// </summary>
|
||||
internal class WasiBinding : Binding
|
||||
{
|
||||
public WasiBinding(IntPtr handle)
|
||||
{
|
||||
_handle = handle;
|
||||
}
|
||||
|
||||
public override SafeHandle Bind(Store store, IHost host)
|
||||
{
|
||||
return new Interop.WasiExportHandle(_handle);
|
||||
}
|
||||
|
||||
private IntPtr _handle;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user