convtest

package
v0.8.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 30, 2026 License: Apache-2.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package convtest binds the WIT world conv.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bits

type Bits uint32

Bits is the WIT flags bits.

const (
	BitsA Bits = 1 << 0
	BitsB Bits = 1 << 1
	BitsC Bits = 1 << 2
	BitsD Bits = 1 << 3
)

type Conv

type Conv struct {
	// contains filtered or unexported fields
}

Conv is an instance of a component of the WIT world conv.

func Instantiate

func Instantiate(ctx context.Context, r wazy.Runtime, wasm []byte, imports Imports, opts ...component.Option) (*Conv, error)

Instantiate instantiates a component of the world conv, with imports implementing its imports. opts are passed on to component.Instantiate, for what the bindings leave to the host, such as WASI.

func (*Conv) Close

func (x *Conv) Close(ctx context.Context) error

Close closes the instance.

func (*Conv) Echo

func (x *Conv) Echo(ctx context.Context, h Holder) (uint32, error)

Echo calls the export echo.

func (*Conv) Instance

func (x *Conv) Instance() *component.Instance

Instance is the underlying component instance.

type ConvFuncs

type ConvFuncs interface {
	Plain(ctx context.Context, x_ uint32) (uint32, error)
}

ConvFuncs is the host's implementation of the functions world conv imports itself.

type Holder

type Holder struct {
	M         map[string]Item
	F         [2]Item
	O         *[]Node
	Okonly    witgo.Result[uint64, struct{}]
	Bare      witgo.Result[struct{}, struct{}]
	Errorly   witgo.Result[struct{}, Level]
	T         witgo.Tuple3[bool, rune, float32]
	B         Bits
	L         Level
	Nested    [][]uint16
	Fixedprim [2]int8
	Ints      []int32
	Chars     []rune
	Bools     []bool
	Long      Tuple9
}

Holder is the WIT record holder.

type Host

type Host interface {
	Take(ctx context.Context, h Holder) (Holder, error)
	Keywords(ctx context.Context, range_ uint32, ctx_ string, err_ int8, chan_ uint16, impl_ bool, res_ uint64) (uint32, error)
	Shuffle(ctx context.Context, t witgo.Tuple3[uint8, int16, uint16]) (map[uint32][]byte, error)
}

Host is the host's implementation of wazy:conv/host@0.1.0.

type Imports

type Imports struct {
	Host      Host
	Other     Other
	ConvFuncs ConvFuncs
}

Imports are the host's implementations of the world's imports.

type Item

type Item struct {
	ID   uint32
	Tags []string
}

Item is the WIT record item.

type Level

type Level uint32

Level is the WIT enum level.

const (
	LevelLow  Level = 0
	LevelHigh Level = 1
)

type Node

type Node struct {
	Case NodeCase
	// contains filtered or unexported fields
}

Node is the WIT variant node: Case says which case it holds.

func NodeLeaf

func NodeLeaf(v uint8) Node

NodeLeaf is the leaf case of Node, holding v.

func NodeNone

func NodeNone() Node

NodeNone is the none case of Node.

func NodePair

func NodePair(v witgo.Tuple2[int16, string]) Node

NodePair is the pair case of Node, holding v.

func (Node) Leaf

func (x Node) Leaf() (uint8, bool)

Leaf is the leaf case's payload, and whether x holds that case.

func (Node) Pair

func (x Node) Pair() (witgo.Tuple2[int16, string], bool)

Pair is the pair case's payload, and whether x holds that case.

type NodeCase

type NodeCase uint32

NodeCase is a case of Node.

const (
	NodeCaseLeaf NodeCase = 0
	NodeCasePair NodeCase = 1
	NodeCaseNone NodeCase = 2
)

type Other

type Other interface {
	UseItem(ctx context.Context, i OtherItem) (OtherItem, error)
}

Other is the host's implementation of wazy:conv/other@0.1.0.

type OtherItem

type OtherItem struct {
	X uint8
}

OtherItem is the WIT record item.

type Tuple9

type Tuple9 struct {
	F0 uint8
	F1 int8
	F2 uint16
	F3 int16
	F4 uint32
	F5 int32
	F6 uint64
	F7 int64
	F8 string
}

Tuple9 is a WIT tuple<u8, s8, u16, s16, u32, s32, u64, s64, string>, its elements in order.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL