package extism

  1. Overview
  2. Docs

Module Extism.ValSource

Val represents low-level WebAssembly values

Sourcetype t

Val

Sourcemodule Array : sig ... end

Val.Array is used for input/output parameters for host functions

Sourceval ty : t -> Val_type.t

ty v returns the Val_type.t for the value v

Sourceval of_i32 : int32 -> t

Create an i32 Val.t

Sourceval of_i64 : int64 -> t

Create an i64 Val

Sourceval of_f32 : float -> t

Create an f32 Val

Sourceval of_f64 : float -> t

Create an f64 Val

Sourceval to_i32 : t -> int32 option

Get an int32 from Val if the type matches

Sourceval to_i64 : t -> int64 option

Get an int64 from Val if the type matches

Sourceval to_f32 : t -> float option

Get a f32 from Val if the type matches

Sourceval to_f64 : t -> float option

Get an f64 from Val if the type matches

Sourceval to_i32_exn : t -> int32

Same as to_i32 but raises Invalid_argument if the types don't match

Sourceval to_i64_exn : t -> int64

Same as to_i64 but raises Invalid_argument if the types don't match

Sourceval to_f32_exn : t -> float

Same as to_f32 but raises Invalid_argument if the types don't match

Sourceval to_f64_exn : t -> float

Same as to_f64 but raises Invalid_argument if the types don't match

OCaml

Innovation. Community. Security.