package extism

  1. Overview
  2. Docs

Module Extism.TypeSource

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

Sourcemodule type S = sig ... end

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

Sourcemodule String : S with type t = string

String type

Sourcemodule Bytes : S with type t = bytes

Bytes type

Sourcemodule Bigstring : S with type t = Bigstringaf.t

Bigstring type

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

Json type

Sourcemodule Unit : S with type t = unit

Unit type, noop

Sourcemodule Int64 : S with type t = int64

Int64 type

Sourcemodule Int32 : S with type t = int32

Int32 type

Sourcemodule Int : S with type t = int

OCaml int type, encoded as an int64

Sourcemodule Float32 : S with type t = float

32-bit float type

Sourcemodule 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) *

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

Innovation. Community. Security.