package wasmer

  1. Overview
  2. Docs

Module Wasmer.ValSource

Sourcetype t
Sourcemodule Anon0 : sig ... end
Sourcemodule O : ObjectType with type t = t Ctypes.structure
include module type of struct include OwnableObject(O) end

The owning structure type.

Sourceval make_new : unit -> s

Make a new owning structure from a new pointer.

Sourceval make_from_raise : O.t Ctypes.ptr -> object_state -> s

Make a new owning structure from a pointer. See also WasmerBindings.OwnableObject.make_from_unsafe.

Sourceval make_from_unsafe : O.t Ctypes.ptr -> object_state -> s

Make a new owning structure from a pointer. Does not raise an exception if NULL is given. See also WasmerBindings.OwnableObject.make_from_raise.

Sourceval make_from_raise_data : O.t Ctypes.ptr -> object_state -> O.d -> s

Make a new owning structure from a pointer, with an additional data. See also WasmerBindings.OwnableObject.make_from_unsafe_data.

Sourceval make_from_unsafe_data : O.t Ctypes.ptr -> object_state -> O.d -> s

Make a new owning structure from a pointer, with an additional data. Does not raise an exception if NULL is given. See also WasmerBindings.OwnableObject.make_from_raise_data.

Sourceval get_state : s -> object_state

Returns the current ownership state.

Sourceval lose_ownership : s -> unit

Sets the current ownership state to WasmerBindings.object_state.State_PassedAway. Ignores the current ownership.

Sourceval grab_ownership : s -> O.t Ctypes.ptr

grab_ownership self gives the ownership of the pointed object to the caller code. It is equivalent to let p = get_ptr self in lose_ownership self; p, but with additional checks for the current ownership.

  • returns

    The pointer

Sourceval gain_ownership_back : s -> O.t Ctypes.ptr

Deletes the object if required, then sets the ownership to WasmerBindings.object_state.State_Owned and returns the pointer. This is only to be used in own-out function arguments in the C API or equivalent.

  • returns

    A deleted or given-away pointer.

  • raises Invalid_access

    If the current state is WasmerBindings.object_state.State_Dependent

Sourceval is_null : s -> bool

Returns Ctypes.is_null on the underlying pointer, ignoring the current ownership state.

Sourceval get_ptr : s -> O.t Ctypes.ptr

Returns the underlying pointer, requiring a sufficient ownership state.

  • raises Invalid_access

    If the current state is lower than WasmerBindings.object_state.State_RW

Sourceval get_ptr_const : s -> O.t Ctypes.ptr

Returns the underlying pointer, requiring a sufficient ownership state.

  • raises Invalid_access

    If the current state is lower than WasmerBindings.object_state.State_Const

Sourceval get_ptr_givenaway : s -> O.t Ctypes.ptr

Inherently unsafe function that returns a given-away pointer.

  • raises Invalid_access

    If the current state is not WasmerBindings.object_state.State_PassedAway

Sourceval delete : s -> unit

Frees the underlying pointer. A side effect is to mark the object as given away.

Sourceval of_i32 : int32 -> s
Sourceval of_i64 : int64 -> s
Sourceval of_f32 : float -> s
Sourceval of_f64 : float -> s
Sourceval of_ref : Ref.s -> s
Sourceval new_ : unit -> s
Sourcetype ocaml =
  1. | I32 of int32
  2. | I64 of int64
  3. | F32 of float
  4. | F64 of float
  5. | Ref of Ref.s
Sourceval get_kind : s -> Valkind.ocaml
Sourceval get_i32 : s -> int32
Sourceval get_i64 : s -> int64
Sourceval get_f32 : s -> float
Sourceval get_f64 : s -> float
Sourceval get_ref : s -> Ref.s
Sourceval of_c : s -> ocaml
Sourceval to_c : ocaml -> s
Sourceval duplicate : s -> s
Sourcemodule V : VectorType with type data_type = t Ctypes.structure with type owning_struct = s
Sourcemodule Vec : sig ... end
OCaml

Innovation. Community. Security.