primitives

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeBool

func DecodeBool(val uint64) bool

func DecodeDuration

func DecodeDuration(val uint64) time.Duration

func DecodeFloat32

func DecodeFloat32(val uint64) float32

func DecodeFloat64

func DecodeFloat64(val uint64) float64

func DecodeInt

func DecodeInt(val uint64) int

func DecodeInt16

func DecodeInt16(val uint64) int16

func DecodeInt32

func DecodeInt32(val uint64) int32

func DecodeInt64

func DecodeInt64(val uint64) int64

func DecodeInt8

func DecodeInt8(val uint64) int8

func DecodeUint

func DecodeUint(val uint64) uint

func DecodeUint16

func DecodeUint16(val uint64) uint16

func DecodeUint32

func DecodeUint32(val uint64) uint32

func DecodeUint64

func DecodeUint64(val uint64) uint64

func DecodeUint8

func DecodeUint8(val uint64) uint8

func DecodeUintptr

func DecodeUintptr(val uint64) uintptr

func EncodeBool

func EncodeBool(val bool) uint64

func EncodeDuration

func EncodeDuration(val time.Duration) uint64

func EncodeFloat32

func EncodeFloat32(val float32) uint64

func EncodeFloat64

func EncodeFloat64(val float64) uint64

func EncodeInt

func EncodeInt(val int) uint64

func EncodeInt16

func EncodeInt16(val int16) uint64

func EncodeInt32

func EncodeInt32(val int32) uint64

func EncodeInt64

func EncodeInt64(val int64) uint64

func EncodeInt8

func EncodeInt8(val int8) uint64

func EncodeUint

func EncodeUint(val uint) uint64

func EncodeUint16

func EncodeUint16(val uint16) uint64

func EncodeUint32

func EncodeUint32(val uint32) uint64

func EncodeUint64

func EncodeUint64(val uint64) uint64

func EncodeUint8

func EncodeUint8(val uint8) uint64

func EncodeUintptr

func EncodeUintptr(val uintptr) uint64

func ReadBool

func ReadBool(mem wasm.Memory, offset uint32) (bool, bool)

func ReadDuration

func ReadDuration(mem wasm.Memory, offset uint32) (time.Duration, bool)

func ReadFloat32

func ReadFloat32(mem wasm.Memory, offset uint32) (float32, bool)

func ReadFloat64

func ReadFloat64(mem wasm.Memory, offset uint32) (float64, bool)

func ReadInt

func ReadInt(mem wasm.Memory, offset uint32) (int, bool)

func ReadInt16

func ReadInt16(mem wasm.Memory, offset uint32) (int16, bool)

func ReadInt32

func ReadInt32(mem wasm.Memory, offset uint32) (int32, bool)

func ReadInt64

func ReadInt64(mem wasm.Memory, offset uint32) (int64, bool)

func ReadInt8

func ReadInt8(mem wasm.Memory, offset uint32) (int8, bool)

func ReadUint

func ReadUint(mem wasm.Memory, offset uint32) (uint, bool)

func ReadUint16

func ReadUint16(mem wasm.Memory, offset uint32) (uint16, bool)

func ReadUint32

func ReadUint32(mem wasm.Memory, offset uint32) (uint32, bool)

func ReadUint64

func ReadUint64(mem wasm.Memory, offset uint32) (uint64, bool)

func ReadUint8

func ReadUint8(mem wasm.Memory, offset uint32) (uint8, bool)

func ReadUintptr

func ReadUintptr(mem wasm.Memory, offset uint32) (uintptr, bool)

func WriteBool

func WriteBool(mem wasm.Memory, offset uint32, val bool) bool

func WriteDuration

func WriteDuration(mem wasm.Memory, offset uint32, val time.Duration) bool

func WriteFloat32

func WriteFloat32(mem wasm.Memory, offset uint32, val float32) bool

func WriteFloat64

func WriteFloat64(mem wasm.Memory, offset uint32, val float64) bool

func WriteInt

func WriteInt(mem wasm.Memory, offset uint32, val int) bool

func WriteInt16

func WriteInt16(mem wasm.Memory, offset uint32, val int16) bool

func WriteInt32

func WriteInt32(mem wasm.Memory, offset uint32, val int32) bool

func WriteInt64

func WriteInt64(mem wasm.Memory, offset uint32, val int64) bool

func WriteInt8

func WriteInt8(mem wasm.Memory, offset uint32, val int8) bool

func WriteUint

func WriteUint(mem wasm.Memory, offset uint32, val uint) bool

func WriteUint16

func WriteUint16(mem wasm.Memory, offset uint32, val uint16) bool

func WriteUint32

func WriteUint32(mem wasm.Memory, offset uint32, val uint32) bool

func WriteUint64

func WriteUint64(mem wasm.Memory, offset uint32, val uint64) bool

func WriteUint8

func WriteUint8(mem wasm.Memory, offset uint32, val uint8) bool

func WriteUintptr

func WriteUintptr(mem wasm.Memory, offset uint32, val uintptr) bool

Types

type TypeConverter

type TypeConverter[T primitive] interface {
	TypeSize() int
	Read(wasm.Memory, uint32) (T, bool)
	Write(wasm.Memory, uint32, T) bool
	Decode(val uint64) T
	Encode(val T) uint64
	BytesToSlice([]byte) []T
	SliceToBytes([]T) []byte
}

func NewPrimitiveTypeConverter

func NewPrimitiveTypeConverter[T primitive]() TypeConverter[T]

Jump to

Keyboard shortcuts

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