package wasmer

  1. Overview
  2. Docs

Module Extern.VecSource

include module type of struct include DeclareVec(V) end
Sourcetype data_type = V.data_type

The vector's data type

Sourceval data_type : data_type Ctypes.typ

The vector's Ctypes data type declaration

Sourceval name : string

The vector name (without the _t)

The C unique (abstract) base type for the structure. the structure type is therefore t structure.

The Ctypes definition of the C structure.

Sourceval fsize : (Unsigned.size_t, t Ctypes.structure) Ctypes.field

The raw size field of the structure

The raw data field of the structure

This structure maintains an ownership status. See also WasmerBindings.OwnableObject.

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.

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

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 : DeclareVec(V).t Ctypes.structure 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 : DeclareVec(V).t Ctypes.structure 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.

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 -> DeclareVec(V).t Ctypes.structure 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.

Returns the underlying pointer, requiring a sufficient ownership state.

  • raises Invalid_access

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

Returns the underlying pointer, requiring a sufficient ownership state.

  • raises Invalid_access

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

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 make_empty : unit -> s

Makes a new vector, calling the wasm_*vec*_new C API function.

Sourceval make_empty_null : unit -> s

Makes a new vector, initializing the data field to NULL.

Sourceval make_uninit : int -> s

Makes a new uninitialized vector.

Sourceval duplicate : s -> s

Duplicates the current vector. No guarantee is made on the deep-ness of the copy.

Sourceval of_array : V.owning_struct array -> s

Makes a vector from an array, taking ownership of the elements.

Sourceval of_list : V.owning_struct list -> s

Makes a vector from a list, taking ownership of the elements.

Sourceval get_size : s -> int

Gets the size field of the vector.

Sourceval get_element : s -> int -> V.owning_struct

get_element vec i gets the ith element of vec with the correct WasmerBindings.object_state.Dependent ownership state.

Sourceval get_element_unsafe : s -> int -> V.owning_struct
Sourceval get_element_const : s -> int -> V.owning_struct

get_element vec i gets the ith element of vec with the correct WasmerBindings.object_state.Dependent ownership state.

Sourceval get_element_const_unsafe : s -> int -> V.owning_struct
Sourceval set_element : s -> int -> V.owning_struct -> unit
Sourceval set_element_unsafe : s -> int -> V.owning_struct -> unit
Sourceval split_kind : s -> Func.s list * Global.s list * Table.s list * Memory.s list
Sourceval split_kind_const : s -> Func.s list * Global.s list * Table.s list * Memory.s list
OCaml

Innovation. Community. Security.