package extism

  1. Overview
  2. Docs

Type defines conversions from OCaml values in and out of Extism memory

module type S = sig ... end

The interface for all types that can be converted between OCaml and Extism host memory

module String : S with type t = string

String type

module Bytes : S with type t = bytes

Bytes type

module Bigstring : S with type t = Bigstringaf.t

Bigstring type

module Json : S with type t = Yojson.Safe.t

Json type

module Unit : S with type t = unit

Unit type, noop

module Int64 : S with type t = int64

Int64 type

module Int32 : S with type t = int32

Int32 type

module Int : S with type t = int

OCaml int type, encoded as an int64

module Float32 : S with type t = float

32-bit float type

module Float64 : S with type t = float

64-bit float type

Packed modules

The following are packed modules that can be passed directly to a function expecting a (module S: Type) *

val string : (module S with type t = string)
val bytes : (module S with type t = bytes)
val bigstring : (module S with type t = Bigstringaf.t)
val json : (module S with type t = Yojson.Safe.t)
val unit : (module S with type t = unit)
val int : (module S with type t = int)
val int64 : (module S with type t = Int64.t)
val int32 : (module S with type t = Int32.t)
val float32 : (module S with type t = Float32.t)
val float64 : (module S with type t = Float64.t)