Class SerializedModule
Modules can either be serialized to byte arrays, or created from a serialized state (byte arrays). This class provides this bridge.
Namespace: WasmerSharp
Assembly: WasmerSharp.dll
Syntax
public class SerializedModule : WasmerSharp.WasmerNativeHandle
Methods
Deserialize()
Deserialize the given serialized module.
Declaration
public WasmerSharp.Module Deserialize ();
Returns
Type | Description |
---|---|
Module | Returns an instance of a Module, or null on error. You can use the LastError error property to get details on the error. |
FromBytes(Byte[])
Creates a new SerializedModule from the provided byte array
Declaration
public static WasmerSharp.SerializedModule FromBytes (byte[] buffer);
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | buffer | Array of bytes containing the serialized module. |
Returns
Type | Description |
---|---|
SerializedModule | Returns null on error, or an instance of SerializeModule on success. You can use the LastError error property to get details on the error. |
FromBytes(IntPtr, UInt32)
Creates a new SerializedModule from the provided buffer.
Declaration
public static WasmerSharp.SerializedModule FromBytes (IntPtr bytes, uint len);
Parameters
Type | Name | Description |
---|---|---|
System.IntPtr | bytes | Pointer to a region in memory containing the serialized module. |
System.UInt32 | len | The number of bytes toe process from the buffer |
Returns
Type | Description |
---|---|
SerializedModule | Returns null on error, or an instance of SerializeModule on success. You can use the LastError error property to get details on the error. |
GetModuleBytes()
Returns the serialized module as a byte array.
Declaration
public byte[] GetModuleBytes ();
Returns
Type | Description |
---|---|
System.Byte[] | The byte array for this serialized module |