package wasmer

  1. Overview
  2. Docs

This module contains all bindings. Currently, only bindings to functions in wasm.h have been implemented.

exception Returned_null of string

A C function returned NULL where a non-null value was required

exception Invalid_access of string

A pointer was accessed but its ownership realtive to the caller was not high enough. For example, trying to get a pointer using get_ptr while the pointer was given away will raise this exception.

type object_state =
  1. | State_Owned
    (*

    The object is owned by the caller.

    *)
  2. | State_RW
    (*

    The object is accessible by the caller.

    *)
  3. | State_Const
    (*

    The object is accessible by the caller in read-only.

    *)
  4. | State_PassedAway
    (*

    The current pointer has been given away.

    *)

The state of the ownership of the pointed-to object.

val get_real_state : object_state -> object_state

Gets the real state of the object_state. Never returns WasmerBindings.object_state.State_Dependent.

val max_state_const : object_state -> object_state

Gets the real state of the object_state, and reduces the ownership to read-only if required. This is the same as get_real_state st if the result is not WasmerBindings.object_state.State_Owned or WasmerBindings.object_state.State_RW, and is WasmerBindings.object_state.State_Const otherwise.

module type ObjectType = sig ... end

The metadata type for ownable objects

module type StructType = sig ... end

The metadata type for structure-declaring objects

module type VectorType = sig ... end

The metadata type for vector structures

module OwnableObject (O : ObjectType) : sig ... end

Ownable objects are the basic structure that maintains an ownership state on C objects.

module DeclareOwn (T : StructType) : sig ... end

The base WASM objects, declared in wasm.h as WASM_DECLARE_OWN.

module DeclareVec (U : VectorType) : sig ... end

The vector type, declared in the C API with the WASM_DECLARE_VEC macro. Vectors always get ownership of their data.

module DeclareType (T : StructType) : sig ... end
module DeclareRefBase (T : StructType) : sig ... end
module Ref_T : StructType
module Ref : sig ... end
module DeclareRef (T : StructType) : sig ... end
module Wasi_ : sig ... end
module Byte : sig ... end
module Name : sig ... end
module Message : sig ... end

Embedders may provide custom functions for manipulating configs.

module Config : sig ... end
module Engine : sig ... end
module Store : sig ... end
module Mutability : sig ... end
module Limits : sig ... end
module Valkind : sig ... end
module Valtype : sig ... end
module Functype : sig ... end
module Globaltype : sig ... end
module Tabletype : sig ... end
module Memorytype : sig ... end
module Externkind : sig ... end
module Externtype : sig ... end
module Importtype : sig ... end
module Exporttype : sig ... end
module Val : sig ... end
module DeclareShareableRef (T : StructType) : sig ... end
module Frame : sig ... end
module Trap : sig ... end
module Foreign : sig ... end
module Module : sig ... end
module Func : sig ... end
module Global : sig ... end
module Table : sig ... end
module Memory : sig ... end
module Extern : sig ... end
module Instance : sig ... end
val frame_instance : Frame.s -> Instance.s
module Wasi : sig ... end
module Util : sig ... end
OCaml

Innovation. Community. Security.